Skip to content

Commit c56bdc1

Browse files
refactor: we can use the Polynomial's = method to reduce the number of assertions and make the tests more DSL like.
1 parent 4b0e6ce commit c56bdc1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ PMPolynomialTest >> testPolynomialMultiplicationIsCommutative [
161161

162162
{ #category : #'testing - addition' }
163163
PMPolynomialTest >> testPolynomialNumberAddition [
164-
| polynomial |
165-
polynomial := 2 + (PMPolynomial coefficients: #(2 -3 1)).
166-
self assert: (polynomial at: 0) equals: 4.
167-
self assert: (polynomial at: 1) equals: -3.
168-
self assert: (polynomial at: 2) equals: 1.
164+
165+
| polynomial expected |
166+
polynomial := 2 + (PMPolynomial coefficients: #( 2 -3 1 )).
167+
expected := PMPolynomial coefficients: #( 4 -3 1 ).
168+
self assert: polynomial equals: expected.
169169
self assert: (polynomial at: 3) equals: 0
170170
]
171171

0 commit comments

Comments
 (0)