Skip to content

Commit a2a38e0

Browse files
committed
Improve printing of reduced test cases
1 parent e11f468 commit a2a38e0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/test_utils.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,20 @@ Reduced the syntax (a string or SyntaxNode) from `file_content` into the
128128
minimal failing subtrees of syntax and write the results to `out`.
129129
"""
130130
function format_reduced_tests(out::IO, file_content; filename=nothing)
131+
println(out, "#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
131132
if !isnothing(filename)
132133
println(out, "# $filename")
133134
end
134135
text = nothing
135136
try
136137
rtrees = reduce_test(file_content)
137-
first = true
138138
for rt in rtrees
139-
if !first
140-
print(out, "\n#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n")
139+
print(out, "\n#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n")
140+
t = sourcetext(rt)
141+
print(out, t)
142+
if !endswith(t, '\n')
143+
println(out)
141144
end
142-
first = false
143-
print(out, sourcetext(rt))
144145
end
145146
catch exc
146147
exc isa InterruptException && rethrow()

0 commit comments

Comments
 (0)