Skip to content

Commit 0a056c5

Browse files
authored
Test for backtrace info. (#46)
1 parent 4ce98c9 commit 0a056c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ end
8181
@test 1 == 2
8282
end
8383
)
84+
error_line = @__LINE__() - 3
8485

8586
io = IOBuffer()
8687
@test_throws Test.FallbackTestSetException("Test run finished with errors") begin
@@ -90,6 +91,7 @@ end
9091
str = String(take!(io))
9192
@test contains(str, r"basic .+ started at")
9293
@test contains(str, r"failing test .+ failed at")
94+
@test contains(str, "$(basename(@__FILE__)):$error_line")
9395
@test contains(str, "FAILURE")
9496
@test contains(str, "Test Failed")
9597
@test contains(str, "1 == 2")
@@ -101,6 +103,7 @@ end
101103
error("This test throws an error")
102104
end
103105
)
106+
error_line = @__LINE__() - 3
104107

105108
io = IOBuffer()
106109
@test_throws Test.FallbackTestSetException("Test run finished with errors") begin
@@ -110,6 +113,7 @@ end
110113
str = String(take!(io))
111114
@test contains(str, r"basic .+ started at")
112115
@test contains(str, r"throwing test .+ failed at")
116+
@test contains(str, "$(basename(@__FILE__)):$error_line")
113117
@test contains(str, "FAILURE")
114118
@test contains(str, "Error During Test")
115119
@test contains(str, "This test throws an error")

0 commit comments

Comments
 (0)