Skip to content

Commit 4522210

Browse files
committed
runtests: add '/' prefix for checking static matches
1 parent bb62478 commit 4522210

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/InlineTest.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ 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], '/'*desc)
126126

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

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,12 @@ using .M: check
5858
check("a", ["a"])
5959
check("a1", []) # testset is "final", so we do a full match
6060
check("b", ["b1", "b2"])
61+
check("/b", ["b1", "b2"])
6162
check("b1", ["b1"])
6263
check("c1", ["c"]) # "c" is partially matched, but nothing fully matches afterwards
6364
check("c/d1", ["c"])
6465
check("c/d", ["c", "d"])
66+
check("/c", ["c", "d", "e1", "e2"])
6567
check(".*d", ["c", "d", "f1"])
6668
check(".*(e1|e2)", ["c", "e1", "e2", "f1"])
6769
check("f1", ["f1", "g", "h1", "h2"])

0 commit comments

Comments
 (0)