Skip to content

Commit 2ba7c68

Browse files
refactor: replaced assertions on coefficients with a Polynomial.
1 parent d4fed03 commit 2ba7c68

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/Math-Tests-Polynomials/PMPolynomialTest.class.st

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,12 @@ PMPolynomialTest >> testPolynomialNumberAdditionInverse [
202202

203203
{ #category : #'testing - division' }
204204
PMPolynomialTest >> testPolynomialNumberDivision [
205-
| polynomial |
206-
polynomial := (PMPolynomial coefficients: #(2 -3 1)) / 2.
207-
self assert: (polynomial at: 0) equals: 1.
208-
self assert: (polynomial at: 1) equals: -3 / 2.
209-
self assert: (polynomial at: 2) equals: 1 / 2.
205+
206+
| polynomial expected expectedCoefficients |
207+
polynomial := (PMPolynomial coefficients: #( 2 -3 1 )) / 2.
208+
expectedCoefficients := Array with: 1 with: -3 / 2 with: 1 / 2.
209+
expected := PMPolynomial coefficients: expectedCoefficients.
210+
self assert: polynomial equals: expected.
210211
self assert: (polynomial at: 3) equals: 0
211212
]
212213

0 commit comments

Comments
 (0)