Skip to content

Commit 167d238

Browse files
test: test RationalPoly isequal methods
1 parent 427e29e commit 167d238

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/commutative/comparison.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,27 @@
109109
@testset "RationalPoly equality" begin
110110
Mod.@polyvar x y
111111
@test (x^2 - x - 6) / (x + 2) != x + 3
112+
@test !isequal((x^2 - x - 6) / (x + 2), x + 3)
112113
@test x - 3 == (x^2 - x - 6) / (x + 2)
114+
@test isequal(x - 3, (x^2 - x - 6) / (x + 2))
113115
@test (x^2 - x - 6) / (x - 3) == x + 2
116+
@test isequal((x^2 - x - 6) / (x - 3), x + 2)
114117
@test 3 != 4x / 2x
118+
@test !isequal(3, 4x / 2x)
115119
@test 4x / 2x == 2
120+
@test isequal(4x / 2x, 2)
116121
@test 3 != 4x / 2x
122+
@test !isequal(3, 4x / 2x)
117123
@test 1 - 1 / x == (x - 1) / x
124+
@test isequal(1 - 1 / x, (x - 1) / x)
118125
@test 1 - 1 / x != (1 - x) / x
126+
@test !isequal(1 - 1 / x, (1 - x) / x)
119127
@test x + x / x == 1 + x^2 / x
128+
@test isequal(x + x / x, 1 + x^2 / x)
120129
@test x - x / x == -(1 - x^2 / x)
130+
@test isequal(x - x / x, -(1 - x^2 / x))
121131
@test (1 + x) / x - 1 == 1 / x
132+
@test isequal((1 + x) / x - 1, 1 / x)
122133
@test isapprox((1 + 1e-8)x, (x * y) / y, rtol = 1e-7)
123134
@test isapproxzero(((1 + 1e-8)x - x) / y, ztol = 1e-7)
124135
@test !isapproxzero(((1 + 1e-8)x - y) / y, ztol = 1e-9)

0 commit comments

Comments
 (0)