Skip to content

Commit 75c2fd8

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

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@ PMPolynomialTest >> testPolynomialMultiplicationIsCommutative [
181181
{ #category : #'testing - addition' }
182182
PMPolynomialTest >> testPolynomialNumberAddition [
183183

184-
| polynomial expected |
185-
polynomial := 2 + (PMPolynomial coefficients: #( 2 -3 1 )).
184+
| polynomial expected p |
185+
p := PMPolynomial coefficients: #( 2 -3 1 ).
186+
polynomial := 2 + p.
186187
expected := PMPolynomial coefficients: #( 4 -3 1 ).
187188
self assert: polynomial equals: expected.
188189
self assert: (polynomial at: 3) equals: 0
@@ -191,8 +192,9 @@ PMPolynomialTest >> testPolynomialNumberAddition [
191192
{ #category : #'testing - addition' }
192193
PMPolynomialTest >> testPolynomialNumberAdditionInverse [
193194

194-
| polynomial expected |
195-
polynomial := (PMPolynomial coefficients: #( 2 -3 1 )) + 2.
195+
| polynomial expected p |
196+
p := PMPolynomial coefficients: #( 2 -3 1 ).
197+
polynomial := p + 2.
196198
expected := PMPolynomial coefficients: #( 4 -3 1 ).
197199
self assert: polynomial equals: expected.
198200
self assert: (polynomial at: 3) equals: 0

0 commit comments

Comments
 (0)