Skip to content

Commit 36bcdf8

Browse files
committed
runtests: for static matches, add a trailing '/' for non-final testsets
1 parent 4522210 commit 36bcdf8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/InlineTest.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ in which it was written (e.g. `m`, when specified).
122122
"""
123123
function runtests(m::Module, regex::Regex = r""; wrap::Bool=false)
124124
partial = partialize(regex)
125-
matches(desc, final) = Testset.partialoccursin((partial, regex)[1+final], '/'*desc)
125+
matches(desc, final) = Testset.partialoccursin((partial, regex)[1+final],
126+
string('/', desc, final ? "" : "/"))
126127

127128
if wrap
128129
Core.eval(m, :(InlineTest.Test.@testset $("Tests for module $m") begin

test/runtests.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ check("a1", []) # testset is "final", so we do a full match
6060
check("b", ["b1", "b2"])
6161
check("/b", ["b1", "b2"])
6262
check("b1", ["b1"])
63-
check("c1", ["c"]) # "c" is partially matched, but nothing fully matches afterwards
63+
check("c1", []) # "c1" is *not* partially matched against "/c/"
64+
check("c/1", ["c"]) # "c" is partially matched, but nothing fully matches afterwards
6465
check("c/d1", ["c"])
6566
check("c/d", ["c", "d"])
6667
check("/c", ["c", "d", "e1", "e2"])

0 commit comments

Comments
 (0)