@@ -105,8 +105,9 @@ const MP = MultivariatePolynomials
105105
106106 @inferred polynomial (i -> float (i), [x, x* x])
107107 @inferred polynomial (i -> 3 - float (i), monovec ([x* x, x]))
108- for p in (polynomial (i -> float (i), [x, x* x]),
109- polynomial (i -> 3 - float (i), monovec ([x* x, x])))
108+ for p in [polynomial (i -> float (i), [x, x* x]),
109+ polynomial (i -> 1.0 , [x* x, x, x* x]),
110+ polynomial (i -> 3 - float (i), monovec ([x* x, x]))]
110111 @test coefficients (p) == [2.0 , 1.0 ]
111112 @test monomials (p) == monovec ([x^ 2 , x])
112113 end
@@ -143,10 +144,16 @@ const MP = MultivariatePolynomials
143144 end
144145
145146 @testset " Convertion" begin
147+ Mod. @polyvar x y z
146148 p = 2.5 x + 1 - 2.5 x
147149 @test convert (Int, p) == 1
148150 @test convert (typeof (p), p) === p
149151 @test convert (Union{Nothing, typeof (p)}, p) === p
152+ a = 2 y
153+ q = polynomial ([a, z, - a], [x, 1 , x])
154+ @test convert_to_constant (q) == z
155+ q = polynomial ([a, z], [x, 1 ])
156+ @test_throws InexactError convert_to_constant (q)
150157 end
151158
152159 @testset " Vector" begin
0 commit comments