diff --git a/exercises/concept/log-parser/test/log_parser_test.exs b/exercises/concept/log-parser/test/log_parser_test.exs index e87583247a..ba11bde364 100644 --- a/exercises/concept/log-parser/test/log_parser_test.exs +++ b/exercises/concept/log-parser/test/log_parser_test.exs @@ -33,8 +33,31 @@ defmodule LogParserTest do end @tag task_id: 1 - test "level must be wrapped in square brackets" do + test "DEBUG level must be wrapped in square brackets" do + assert LogParser.valid_line?("DEBUG something really bad happened") == false + assert LogParser.valid_line?("[DEBUG something really bad happened") == false + assert LogParser.valid_line?("DEBUG] something really bad happened") == false + end + + @tag task_id: 1 + test "INFO level must be wrapped in square brackets" do + assert LogParser.valid_line?("INFO something really bad happened") == false + assert LogParser.valid_line?("[INFO something really bad happened") == false + assert LogParser.valid_line?("INFO] something really bad happened") == false + end + + @tag task_id: 1 + test "WARNING level must be wrapped in square brackets" do + assert LogParser.valid_line?("WARNING something really bad happened") == false + assert LogParser.valid_line?("[WARNING something really bad happened") == false + assert LogParser.valid_line?("WARNING] something really bad happened") == false + end + + @tag task_id: 1 + test "ERROR level must be wrapped in square brackets" do assert LogParser.valid_line?("ERROR something really bad happened") == false + assert LogParser.valid_line?("[ERROR something really bad happened") == false + assert LogParser.valid_line?("ERROR] something really bad happened") == false end @tag task_id: 1