From b64ab187f8ebf55d1b182d835fd215b2c6f742ee Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 17 Jul 2012 18:20:07 +0100 Subject: TEST: Simplify the rendered error tests in the compiler suite --- test/test-lace.compiler.lua | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/test/test-lace.compiler.lua b/test/test-lace.compiler.lua index ab2f12c..284ca74 100644 --- a/test/test-lace.compiler.lua +++ b/test/test-lace.compiler.lua @@ -197,10 +197,6 @@ function suite.error_does_not_exist() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be in the implicit includes local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("does%-not%-exist"), "The first line must mention the error") assert(line2 == "Implicit inclusion of does-not-exist :: 1", "The second line is where the error happened") assert(line3 == "include does-not-exist", "The third line is the original line") @@ -214,10 +210,6 @@ function suite.error_in_define() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be on line 3 word 3 of 'errorindefine' local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("does_not_exist"), "The first line must mention the error") assert(line2 == "real-errorindefine :: 3", "The second line is where the error happened") assert(line3 == "define fish does_not_exist", "The third line is the original line") @@ -231,10 +223,6 @@ function suite.error_in_define_anyof1() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be on line 3 word 3 of 'errorindefine' local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("at least"), "The first line must mention the error") assert(line2 == "real-errorindefineanyof1 :: 3", "The second line is where the error happened") assert(line3 == "define fish anyof", "The third line is the original line") @@ -248,10 +236,6 @@ function suite.error_in_define_anyof2() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be on line 3 word 3 of 'errorindefine' local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("at least"), "The first line must mention the error") assert(line2 == "real-errorindefineanyof2 :: 3", "The second line is where the error happened") assert(line3 == "define fish anyof something", "The third line is the original line") @@ -265,10 +249,6 @@ function suite.error_in_allow_or_deny() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be on line 3 word 3 of 'errorindefine' local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("Expected reason"), "The first line must mention the error") assert(line2 == "real-errorinallow :: 3", "The second line is where the error happened") assert(line3 == "allow", "The third line is the original line") @@ -282,10 +262,6 @@ function suite.error_in_define_default1() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be on line 3 word 3 of 'errorindefine' local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("Expected result"), "The first line must mention the error") assert(line2 == "real-errorindefault1 :: 3", "The second line is where the error happened") assert(line3 == "default", "The third line is the original line") @@ -299,10 +275,6 @@ function suite.error_in_define_default2() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be on line 3 word 3 of 'errorindefine' local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("allow or deny"), "The first line must mention the error") assert(line2 == "real-errorindefault2 :: 3", "The second line is where the error happened") assert(line3 == "default fish", "The third line is the original line") @@ -316,10 +288,6 @@ function suite.error_in_define_default3() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be on line 3 word 3 of 'errorindefine' local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("additional"), "The first line must mention the error") assert(line2 == "real-errorindefault3 :: 3", "The second line is where the error happened") assert(line3 == 'default allow "" extrashite', "The third line is the original line") @@ -333,10 +301,6 @@ function suite.error_in_define_default4() assert(msg:find("\n"), "Compilation errors are multiline") -- This error should be on line 3 word 3 of 'errorindefine' local line1, line2, line3, line4 = msg:match("^([^\n]*)\n([^\n]*)\n([^\n]*)\n([^\n]*)$") - assert(line1, "There is a line 1") - assert(line2, "There is a line 2") - assert(line3, "There is a line 3") - assert(line4, "There is a line 4") assert(line1:find("Cannot change"), "The first line must mention the error") assert(line2 == "real-errorindefault4 :: 5", "The second line is where the error happened") assert(line3 == 'default allow', "The third line is the original line") -- cgit v1.2.1