Skip to content

Commit 66e8253

Browse files
committed
added tests with deflost in operation call with more than two arguments
1 parent a5b4d8f commit 66e8253

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/rewrite.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ end
9898
@test r_mix((a + b*c)^2) === (2, c)
9999
@test r_mix((a + b*c)) === (1, c)
100100
@test r_mix((a + b)) === (1, 1)
101+
102+
r_more_than_two_arguments = @rule (~!a)*exp(~x)*sin(~x) => (~a, ~x)
103+
@test r_more_than_two_arguments(sin(x)*exp(x)) === (1, x)
104+
@test r_more_than_two_arguments(sin(x)*exp(x)*a) === (a, x)
105+
106+
r_mixmix = @rule (~!a)*exp(~x)*sin(~!b + (~x)^2 + ~x) => (~a, ~b, ~x)
107+
@test r_mixmix(exp(x)*sin(1+x+x^2)*2) === (2, 1, x)
108+
@test r_mixmix(exp(x)*sin(x+x^2)*2) === (2, 0, x)
109+
@test r_mixmix(exp(x)*sin(x+x^2)) === (1, 0, x)
101110
end
102111

103112
@testset "1/power matches power with exponent of opposite sign" begin

0 commit comments

Comments
 (0)