Skip to content

Commit 63b3779

Browse files
refactor: extracted magic number and integrand to local variables.
1 parent 4b89858 commit 63b3779

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ PMPolynomialTest >> testPolynomialIntegral [
143143
PMPolynomialTest >> testPolynomialIntegralWithConstant [
144144
"Code example 2.3"
145145

146-
| polynomial |
147-
polynomial := (PMPolynomial coefficients: #(-3 7 2 1)) integral: 5.
146+
| polynomial arbitraryConstant p |
147+
arbitraryConstant := 5.
148+
p := PMPolynomial coefficients: #( -3 7 2 1 ).
149+
polynomial := p integral: arbitraryConstant.
148150
self assert: (polynomial at: 0) equals: 5.
149151
self assert: (polynomial at: 1) equals: -3.
150152
self assert: (polynomial at: 2) equals: 7 / 2.

0 commit comments

Comments
 (0)