Skip to content

Commit 04e27b9

Browse files
committed
simplify the Dict into a Vector, force conformance to at-testset
1 parent e739564 commit 04e27b9

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/InlineTest.jl

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,13 @@ __init__() = INLINE_TEST[] = gensym()
1212
function tests(m)
1313
inline_test::Symbol = m (InlineTest, InlineTest.InlineTestTest) ? :__INLINE_TEST__ : INLINE_TEST[]
1414
if !isdefined(m, inline_test)
15-
@eval m $inline_test = Dict{AbstractString, Expr}()
15+
@eval m $inline_test = Expr[]
1616
end
1717
getfield(m, inline_test)
1818
end
1919

2020
function addtest(args::Tuple, m::Module)
21-
n = findfirst(a -> a isa String, args)
22-
desc = n === nothing ? nothing : args[n]
23-
desc !== nothing && haskey(tests(m), desc) && @warn("Test $desc already defined for module $(string(m)), overwriting")
24-
if desc === nothing
25-
i = 1
26-
while haskey(tests(m), "anonymous test $i")
27-
i += 1
28-
end
29-
desc = "anonymous test $i"
30-
end
31-
tests(m)[desc] = :(@testset($(args...)))
21+
push!(tests(m), :(@testset($(args...))))
3222
nothing
3323
end
3424

@@ -37,7 +27,7 @@ macro addtest(args...)
3727
end
3828

3929
function runtests(m::Module)
40-
tss = collect(values(tests(m)))
30+
tss = tests(m)
4131
tsm = :(@testset $("Tests for module $m") begin
4232
$(tss...)
4333
end)

0 commit comments

Comments
 (0)