Skip to content

Commit

Permalink
Merge pull request #54 from blegat/range
Browse files Browse the repository at this point in the history
Add range tests
  • Loading branch information
blegat authored Sep 25, 2017
2 parents e2fa373 + 3188ed1 commit 58ff28c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/monovec.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export monovec, monovectype, emptymonovec, sortmonovec, mergemonovec

monomials(v::AbstractVariable, args...) = monomials((v,), args...)

"""
emptymonovec(p::AbstractPolynomialLike)
Expand Down
1 change: 1 addition & 0 deletions test/monovec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@
@test monomialtype([x*y, x+y]) <: AbstractMonomial

@test monovec([x, x^2]) != monovec([x*y, x^2*y])
@test monomials(x, 1:3) == monovec([x^3, x, x^2])
@test monomials((x, y), 2) != monomials((x, y), 1)
end
3 changes: 3 additions & 0 deletions test/polynomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
#@inferred one(1.0 + x)
@inferred zero(1.0 + x)

@test polynomial(1:2, [x, x^2]) == x + 2x^2
@test polynomial(1:2, monomials(x, 1:2)) == 2x + x^2

@test terms(polynomial(1 + x + x^2 - x + x^2)) == [2x^2, 1]
@test terms(CustomPoly(1 + x + x^2 - x + x^2)) == [2x^2, 1]

Expand Down

0 comments on commit 58ff28c

Please sign in to comment.