Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Sep 6, 2023
1 parent 115d97c commit 6cc2f52
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/rewrite_generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,14 @@ function test_rewrite_expression()
@test MA.@rewrite(x + *(2, x, 3), move_factors_into_sums = false) ==
x + *(2, x, 3)
y = 1.2
@test MA.@rewrite(
sum(y for i in 1:2) + 2y,
move_factors_into_sums = false
) == 4y
@test MA.@rewrite(
sum(y for i in 1:2) + y * y,
move_factors_into_sums = false
) == 2y + y^2
@test MA.@rewrite(y + 2 * y, move_factors_into_sums = false) == 3y
@test MA.@rewrite(y + *(2, y, 3), move_factors_into_sums = false) ==
y + *(2, y, 3)
Expand Down

0 comments on commit 6cc2f52

Please sign in to comment.