Skip to content

Commit 31baea4

Browse files
refactor: used the assert: equals: message to take advantage of Polynomial's = message.
1 parent 03ae30d commit 31baea4

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ PMPolynomialTest >> testPolynomialAdditionIsCommutative [
4040
PMPolynomialTest >> testPolynomialDerivative [
4141
"Code example 2.3"
4242

43-
| polynomial |
44-
polynomial := (PMPolynomial coefficients: #(-3 7 2 1)) derivative.
45-
self assert: (polynomial at: 0) equals: 7.
46-
self assert: (polynomial at: 1) equals: 4.
47-
self assert: (polynomial at: 2) equals: 3.
43+
| polynomial expectedDerivative |
44+
polynomial := (PMPolynomial coefficients: #( -3 7 2 1 )) derivative.
45+
expectedDerivative := PMPolynomial coefficients: #( 7 4 3 ).
46+
self assert: polynomial equals: expectedDerivative.
4847
self assert: (polynomial at: 3) equals: 0.
4948
self assert: (polynomial at: 4) equals: 0
5049
]

0 commit comments

Comments
 (0)