Skip to content

Commit ea96fec

Browse files
committed
Test for Issue #104
1 parent 0e53689 commit ea96fec

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/division.jl

+6
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,12 @@ function multivariate_gcd_test(::Type{T}, algo=GeneralizedEuclideanAlgorithm())
196196
sym_test(p1, p2, x, algo)
197197
end
198198

199+
@testset "Issue #104" begin
200+
p1 = o - o * x
201+
p2 = p1 * (o * y^2 + o)
202+
sym_test(p1, p2, p1, algo)
203+
end
204+
199205
p1 = o*z - z
200206
p2 = z
201207
@test gcd(p1, p2, algo) == z

test/monomial.jl

+12
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,21 @@ function mapexponents_test()
2323
b = x * y
2424
c = MP.mapexponents!(+, a, b)
2525
@test variables(c) == variables(b)
26+
@test degree(c, x) == 3
27+
@test degree(c, y) == 1
2628
a = x^3
2729
d = MP.mapexponents_to!(a, -, b, b)
2830
@test variables(d) == variables(b)
31+
@test degree(d, x) == 0
32+
@test degree(d, y) == 0
33+
# See https://github.com/JuliaAlgebra/DynamicPolynomials.jl/pull/105
34+
e = x^1
35+
f = x * y^2
36+
g = MP.mapexponents!(div, e, f)
37+
@test g === e
38+
@test variables(e) == variables(f)
39+
@test degree(e, x) == 1
40+
@test degree(e, y) == 0
2941
end
3042

3143
@testset "Monomial" begin

0 commit comments

Comments
 (0)