From c76f8f920dffcf9de7af83ec57ef51215b12bdaa Mon Sep 17 00:00:00 2001 From: hemalvarambhia Date: Wed, 27 Dec 2023 19:08:22 +0000 Subject: [PATCH] refactor: extracted temp, renamed a temp to tell a better story. --- .../PMPolynomialTest.class.st | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Math-Tests-Polynomials/PMPolynomialTest.class.st b/src/Math-Tests-Polynomials/PMPolynomialTest.class.st index 90043214..cc3e8383 100644 --- a/src/Math-Tests-Polynomials/PMPolynomialTest.class.st +++ b/src/Math-Tests-Polynomials/PMPolynomialTest.class.st @@ -40,12 +40,15 @@ PMPolynomialTest >> testPolynomialAdditionIsCommutative [ PMPolynomialTest >> testPolynomialDerivative [ "Code example 2.3" - | polynomial expectedDerivative | - polynomial := (PMPolynomial coefficients: #( -3 7 2 1 )) derivative. + | p derivative expectedDerivative | + p := PMPolynomial coefficients: #( -3 7 2 1 ). + + derivative := p derivative. + expectedDerivative := PMPolynomial coefficients: #( 7 4 3 ). - self assert: polynomial equals: expectedDerivative. - self assert: (polynomial at: 3) equals: 0. - self assert: (polynomial at: 4) equals: 0 + self assert: derivative equals: expectedDerivative. + self assert: (derivative at: 3) equals: 0. + self assert: (derivative at: 4) equals: 0 ] { #category : #'testing - division' }