Skip to content

Commit d4fed03

Browse files
refactor: Extract Variable so we can demonstrate the operation being tested clearly.
1 parent 75c2fd8 commit d4fed03

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,21 @@ PMPolynomialTest >> testPolynomialNumberDivision [
213213
{ #category : #'testing - multiplication' }
214214
PMPolynomialTest >> testPolynomialNumberMultiplication [
215215

216-
| product expected |
217-
product := 2 * (PMPolynomial coefficients: #( 2 -3 1 )).
218-
216+
| product expected p |
217+
p := PMPolynomial coefficients: #( 2 -3 1 ).
218+
product := 2 * p.
219+
219220
expected := PMPolynomial coefficients: #( 4 -6 2 ).
220221
self assert: product equals: expected
221222
]
222223

223224
{ #category : #'testing - multiplication' }
224225
PMPolynomialTest >> testPolynomialNumberMultiplicationInverse [
225226

226-
| product expected |
227-
product := (PMPolynomial coefficients: #( 2 -3 1 )) * 2.
228-
227+
| product expected p |
228+
p := PMPolynomial coefficients: #( 2 -3 1 ).
229+
product := p * 2.
230+
229231
expected := PMPolynomial coefficients: #( 4 -6 2 ).
230232
self assert: product equals: expected
231233
]

0 commit comments

Comments
 (0)