Skip to content

Commit 81037dc

Browse files
committed
Added a test for roots() for LaurentPolynomial.
1 parent 4816e41 commit 81037dc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/StandardBasis.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ end
247247
@test (P([NaN]) NaN) == (false)
248248
@test (P([Inf]) P([Inf])) == ([Inf] [Inf]) # true
249249
@test (P([Inf]) Inf) == (true)
250-
@test (P([1,Inf]) P([0,Inf])) == ([1,Inf] [0,Inf]) # false
251-
@test (P([1,NaN,Inf]) P([0,NaN, Inf])) == ([1,NaN,Inf] [0,NaN, Inf]) #false
250+
@test (P([1,Inf]) P([0,Inf])) == ([1,Inf] [0,Inf]) # false
251+
@test (P([1,NaN,Inf]) P([0,NaN, Inf])) == ([1,NaN,Inf] [0,NaN, Inf]) #false
252252
@test (P([eps(), eps()]) P([0,0])) == ([eps(), eps()] [0,0]) # false
253253
@test (P([1,eps(), 1]) P([1,0,1])) == ([1,eps(), 1] [1,0,1]) # true
254254
@test (P([1,2]) P([1,2,eps()])) == ([1,2,0] [1,2,eps()])
@@ -431,6 +431,8 @@ end
431431
@test roots(pNULL) == []
432432
@test sort(roots(pR)) == [1 // 2, 3 // 2]
433433

434+
@test roots(LaurentPolynomial([24,10,-15,0,1],-2:1,:z))[-4,-1,2,3]
435+
434436
A = [1 0; 0 1]
435437
@test fromroots(A) == Polynomial(Float64[1, -2, 1])
436438
p = fromroots(P, A)
@@ -511,7 +513,7 @@ end
511513
q = [3, p1]
512514
if P != ImmutablePolynomial
513515
@test q isa Vector{typeof(p1)}
514-
@test p isa Vector{typeof(p2)}
516+
@test p isa Vector{typeof(p2)}
515517
else
516518
@test q isa Vector{P{eltype(p1)}} # ImmutablePolynomial{Int64,N} where {N}, different Ns
517519
@test p isa Vector{P{eltype(p2)}} # ImmutablePolynomial{Int64,N} where {N}, different Ns
@@ -651,7 +653,7 @@ end
651653
end
652654

653655
@test eltype(p1) == Int
654-
for P in Ps
656+
for P in Ps
655657
p1 = P([1,2,0,3])
656658
@test eltype(collect(p1)) <: P{Int}
657659
@test eltype(collect(P{Float64}, p1)) <: P{Float64}
@@ -754,7 +756,7 @@ end
754756
for n in (2,5,10,20,50, 100)
755757
p = (x-1)^n * (x-2)^n * (x-3)
756758
q = (x-1) * (x-2) * (x-4)
757-
@test degree(gcd(p,q, method=:numerical)) == 2
759+
@test degree(gcd(p,q, method=:numerical)) == 2
758760
end
759761
end
760762
end
@@ -889,6 +891,6 @@ end
889891
@test typeof(p₁) == P{T,5} # conversion works
890892
@test_throws InexactError P{T}(rand(5))
891893
end
892-
end
894+
end
893895

894896
end

0 commit comments

Comments
 (0)