diff --git a/test/test_testitems.jl b/test/test_testitems.jl index c5f489a..a1ac98f 100644 --- a/test/test_testitems.jl +++ b/test/test_testitems.jl @@ -16,7 +16,7 @@ @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "Your @testitem is missing a name and code block.", 1:9) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "Test definition error", "Your @testitem is missing a name and code block.", 1:9) end @testitem "Wrong type for name" begin @@ -37,7 +37,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "Your @testitem must have a first argument that is of type String for the name.", 1:14) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "Test definition error", "Your @testitem must have a first argument that is of type String for the name.", 1:14) end @testitem "Code block missing" begin @@ -58,7 +58,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "Your @testitem is missing a code block argument.", 1:15) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "Your @testitem is missing a code block argument.", 1:15) end @testitem "Final arg not a code block" begin @@ -79,7 +79,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "The final argument of a @testitem must be a begin end block.", 1:17) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "The final argument of a @testitem must be a begin end block.", 1:17) end @testitem "None kw arg" begin @@ -100,7 +100,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "The arguments to a @testitem must be in keyword format.", 1:29) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "The arguments to a @testitem must be in keyword format.", 1:29) end @testitem "Duplicate kw arg" begin @@ -121,7 +121,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "The keyword argument default_imports cannot be specified more than once.", 1:68) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "The keyword argument default_imports cannot be specified more than once.", 1:68) end @testitem "Incomplete kw arg" begin @@ -142,7 +142,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "The final argument of a @testitem must be a begin end block.", 1:42) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "The final argument of a @testitem must be a begin end block.", 1:42) end @testitem "Wrong default_imports type kw arg" begin @@ -163,7 +163,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "The keyword argument default_imports only accepts bool values.", 1:43) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "The keyword argument default_imports only accepts bool values.", 1:43) end @testitem "non vector arg for tags kw" begin @@ -184,7 +184,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "The keyword argument tags only accepts a vector of symbols.", 1:32) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "The keyword argument tags only accepts a vector of symbols.", 1:32) end @testitem "Wrong types in tags kw arg" begin @@ -205,7 +205,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "The keyword argument tags only accepts a vector of symbols.", 1:37) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "The keyword argument tags only accepts a vector of symbols.", 1:37) end @testitem "Unknown keyword arg" begin @@ -226,7 +226,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "Unknown keyword argument.", 1:34) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "foo", "Unknown keyword argument.", 1:34) end @testitem "All parts correctly there" begin @@ -276,7 +276,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "Your @testmodule is missing a name and code block.", 1:length(content)-1) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "Test definition error", "Your @testmodule is missing a name and code block.", 1:length(content)-1) end @testitem "@testsnippet macro missing begin end block" begin @@ -297,7 +297,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "Your @testsnippet is missing a name and code block.", 1:length(content)-1) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "Test definition error", "Your @testsnippet is missing a name and code block.", 1:length(content)-1) end @testitem "@testmodule macro extra args" begin @@ -317,7 +317,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "Your @testmodule must have a first argument that is an identifier for the name.", 1:length(content)) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "Test definition error", "Your @testmodule must have a first argument that is an identifier for the name.", 1:length(content)) end @testitem "@testsnippet macro extra args" begin @@ -337,7 +337,7 @@ end @test length(test_results.testsetups) == 0 @test length(test_results.testerrors) == 1 - @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "Your @testsnippet must have a first argument that is an identifier for the name.", 1:length(content)) + @test test_results.testerrors[1] == TestErrorDetail(uri"file://src/foo.jl", "file://src/foo.jl:error1", "Test definition error", "Your @testsnippet must have a first argument that is an identifier for the name.", 1:length(content)) end @testitem "@testmodule all correct" begin