Skip to content

Commit 57eed3e

Browse files
committed
added tests for power match with sqrt and exp functions
1 parent 0a76487 commit 57eed3e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/rewrite.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,12 @@ end
153153
@test r3(a + b^3)===a
154154
end
155155

156+
@testset "special power matches" begin
157+
r1 = @rule (~x)^(~y) => (~x, ~y)
158+
@test r1(exp(a)) === (ℯ, a) # uses exp_matcher
159+
@test r1(sqrt(a)) === (a, 1//2) # uses sqrt_matcher
160+
end
161+
156162
using SymbolicUtils: @capture
157163

158164
@testset "Capture form" begin
@@ -214,4 +220,4 @@ end
214220
ex1 = ex * b
215221

216222
@test getmetadata(arguments(ex1)[1], MetaData) == :metadata
217-
end
223+
end

0 commit comments

Comments
 (0)