File tree Expand file tree Collapse file tree
src/Math-Tests-Polynomials Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,15 +143,18 @@ PMPolynomialTest >> testPolynomialIntegral [
143143PMPolynomialTest >> testPolynomialIntegralWithConstant [
144144 " Code example 2.3"
145145
146- | polynomial arbitraryConstant integrand |
146+ | polynomial arbitraryConstant integrand expectedCoefficients expected |
147147 arbitraryConstant := 5 .
148148 integrand := PMPolynomial coefficients: #( -3 7 2 1 ) .
149149 polynomial := integrand integral: arbitraryConstant.
150- self assert: (polynomial at: 0 ) equals: 5 .
151- self assert: (polynomial at: 1 ) equals: - 3 .
152- self assert: (polynomial at: 2 ) equals: 7 / 2 .
153- self assert: (polynomial at: 3 ) equals: 2 / 3 .
154- self assert: (polynomial at: 4 ) equals: 1 / 4 .
150+ expectedCoefficients := Array
151+ with: 5
152+ with: - 3
153+ with: 7 / 2
154+ with: 2 / 3
155+ with: 1 / 4 .
156+ expected := PMPolynomial coefficients: expectedCoefficients.
157+ self assert: polynomial equals: expected.
155158 self assert: (polynomial at: 5 ) equals: 0
156159]
157160
You can’t perform that action at this time.
0 commit comments