Skip to content

Commit ea0323d

Browse files
authored
Better way to handle #457 (#474)
1 parent 28d6137 commit ea0323d

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

src/common.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,11 +638,7 @@ has a nonzero coefficient. The degree of the zero polynomial is defined to be -1
638638
"""
639639
degree(p::AbstractPolynomial) = iszero(coeffs(p)) ? -1 : length(coeffs(p)) - 1 + min(0, minimumexponent(p))
640640

641-
function order(p::AbstractPolynomial)
642-
Base.depwarn("The `order` function is deprecated. Use `degree`.",
643-
:AbstractPolynomial)
644-
degree(p)
645-
end
641+
@deprecate order degree false
646642

647643

648644
"""

test/ChebyshevT.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
@test p.coeffs == coeff
1111
@test coeffs(p) == coeff
1212
@test degree(p) == length(coeff) - 1
13+
@test (@test_deprecated Polynomials.order(p)) == length(coeff) - 1 # issue 457
1314
@test Polynomials.indeterminate(p) == :x
1415
@test length(p) == length(coeff)
1516
@test size(p) == size(coeff)

test/StandardBasis.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ isimmutable(::Type{<:ImmutablePolynomial}) = true
6666
## issue 464
6767
@variable z
6868
@test z^2 + 2 == Polynomial([2,0,1], :z)
69+
70+
## issue 457
71+
@test (@test_deprecated Polynomials.order(p)) == length(coeff) - 1
6972
end
7073
end
7174
end
@@ -146,15 +149,10 @@ Base.getindex(z::ZVector, I::Int) = parent(z)[I + z.offset]
146149
@test degree(Polynomials.basis(P,5)) == 5
147150
@test Polynomials.isconstant(P(1))
148151
@test !Polynomials.isconstant(variable(P))
149-
end
150152

151-
## issue #457
152-
if VERSION >= v"1.7.0"
153-
p = Polynomial([1,2,3])
154-
@test_warn "deprecated" Polynomials.order(p)
155-
@test Polynomials.order(p) == 2
156153
end
157154

155+
158156
end
159157

160158
@testset "Non-number type" begin

0 commit comments

Comments
 (0)