Skip to content

Commit 195b673

Browse files
committed
simpler tests
1 parent 9d2dada commit 195b673

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/patch.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ testrep(ex, text) = textmap(_ -> Expr(:file, ex), text)
55

66
# Replacement
77

8-
@test textwalk(x -> x==:a ? :b : x, "a*2") == "b*2"
9-
@test textwalk(x -> x==:a ? :b : x, "a * 2") == "b * 2"
10-
@test textwalk(x -> x == :a ? 2 : x, "a * b * c") == "2 * b * c"
11-
@test textwalk(x -> x == :* ? :f : x, "a * b") == "f(a, b)"
8+
@test testrep(:(b*2), "a*2") == "b*2"
9+
@test testrep(:(b*2), "a * 2") == "b * 2"
10+
@test testrep(:(2*b*c), "a * b * c") == "2 * b * c"
11+
@test testrep(:(f(a, b)), "a * b") == "f(a, b)"
1212

13-
@test textwalk(x -> x == :a ? :(a+1) : x, "a * 2") == "(a + 1) * 2"
14-
@test textwalk(x -> x == :a ? :(a+1) : x, "*(a, 2)") == "*(a + 1, 2)"
13+
@test testrep(:((a+1)*2), "a * 2") == "(a + 1) * 2"
14+
@test testrep(:((a+1)*2), "*(a, 2)") == "*(a + 1, 2)"
1515

16-
@test textwalk(x -> x isa String ? :(uppercase($x)) : x, """
16+
@test testrep(:(bar(uppercase("baz"))), """
1717
bar("baz")
1818
""") == """
1919
bar(uppercase("baz"))

0 commit comments

Comments
 (0)