Skip to content

Commit 6552725

Browse files
committed
Update tests to include TypedPolynomials again
1 parent 62ec3df commit 6552725

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

test/REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
BenchmarkTools
22
DynamicPolynomials 0.1
3+
TypedPolynomials

test/runtests.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,14 @@ function try_import(name::Symbol)
1717
end
1818

1919
global implementation = :DynamicPolynomials
20-
2120
if try_import(:DynamicPolynomials)
2221
Mod = DynamicPolynomials
2322
include("commutativetests.jl")
2423
include("noncommutativetests.jl")
2524
end
2625

26+
global implementation = :TypedPolynomials
2727
if try_import(:TypedPolynomials)
2828
Mod = TypedPolynomials
29-
global implementation = :TypedPolynomials
3029
include("commutativetests.jl")
3130
end

test/show.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
@test sprint(show, x^2 - (1.0 + 3.1im) * x) == "x² + (-1.0 - 3.1im)x"
2727
@test sprint(show, [1.0, 2.0] * x) == "([1.0, 2.0])x"
2828

29-
#This is only supported by DynamicPolynomials so far
30-
if implementation == :DynamicPolynomials
31-
Mod.@polyvar x[0:9]
32-
@test sprint(show, sum(i*x[i]^i for i=1:10)) == "10x₉¹⁰ + 9x₈⁹ + 8x₇⁸ + 7x₆⁷ + 6x₅⁶ + 5x₄⁵ + 4x₃⁴ + 3x₂³ + 2x₁² + x₀"
33-
@test sprint(show, "text/latex", sum(i*x[i]^i for i=1:10)) == "10x_{9}^{10} + 9x_{8}^{9} + 8x_{7}^{8} + 7x_{6}^{7} + 6x_{5}^{6} + 5x_{4}^{5} + 4x_{3}^{4} + 3x_{2}^{3} + 2x_{1}^{2} + x_{0}"
29+
Mod.@polyvar x[0:9]
30+
@test sprint(show, sum(i*x[i]^i for i=1:10)) == "10x₉¹⁰ + 9x₈⁹ + 8x₇⁸ + 7x₆⁷ + 6x₅⁶ + 5x₄⁵ + 4x₃⁴ + 3x₂³ + 2x₁² + x₀"
31+
@test sprint(show, "text/latex", sum(i*x[i]^i for i=1:10)) == "10x_{9}^{10} + 9x_{8}^{9} + 8x_{7}^{8} + 7x_{6}^{7} + 6x_{5}^{6} + 5x_{4}^{5} + 4x_{3}^{4} + 3x_{2}^{3} + 2x_{1}^{2} + x_{0}"
3432

33+
#This is only supported by DynamicPolynomials so far
34+
@static if implementation == :DynamicPolynomials
3535
Mod.@polyvar A[1:2, 1:2]
3636
@test sprint(show, sum(A)) == "A₁₋₁ + A₂₋₁ + A₁₋₂ + A₂₋₂"
3737
@test sprint(show, "text/latex", sum(A)) == "A_{1,1} + A_{2,1} + A_{1,2} + A_{2,2}"

0 commit comments

Comments
 (0)