Skip to content

Commit 67a5c93

Browse files
authored
Mini-tests!
The pass-through method for `variable` wasn't tested and neither is `chop`.
1 parent 723fc07 commit 67a5c93

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/runtests.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ a_roots = copy(pN.a)
7777
@test length(roots(p5)) == 4
7878
@test roots(pNULL) == []
7979
@test sort(roots(pR)) == [1//2, 3//2]
80-
x = variable(Float64)
80+
# default type in variable() is Float64
81+
x = variable()
8182
plarge = 8.362779449448982e41 - 2.510840694154672e57x + 4.2817430781178795e44x^2 - 1.6225927682921337e31x^3 + 1.0x^4 # #120
8283
@test length(roots(plarge)) == 4
8384

@@ -101,6 +102,11 @@ p4 = p2 * p3
101102
@test_throws DivideError p1 ÷ p0
102103
@test_throws DivideError divrem(p0,p0)
103104

105+
# test chop
106+
pchop = Poly([1, 2, 3, 0, 0, 0])
107+
pchopped = chop(pchop)
108+
@test roots(pchop) == roots(pchopped)
109+
104110
#Tests for multivariable support
105111
pX = Poly([1, 2, 3, 4, 5])
106112
pS1 = Poly([1, 2, 3, 4, 5], "s")

0 commit comments

Comments
 (0)