From d4fed030aca4c6a34b2313cd2e298c8a1f832dc3 Mon Sep 17 00:00:00 2001 From: hemalvarambhia Date: Wed, 27 Dec 2023 19:52:24 +0000 Subject: [PATCH] refactor: Extract Variable so we can demonstrate the operation being tested clearly. --- .../PMPolynomialTest.class.st | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Math-Tests-Polynomials/PMPolynomialTest.class.st b/src/Math-Tests-Polynomials/PMPolynomialTest.class.st index 7000186c..ad2fbdc9 100644 --- a/src/Math-Tests-Polynomials/PMPolynomialTest.class.st +++ b/src/Math-Tests-Polynomials/PMPolynomialTest.class.st @@ -213,9 +213,10 @@ PMPolynomialTest >> testPolynomialNumberDivision [ { #category : #'testing - multiplication' } PMPolynomialTest >> testPolynomialNumberMultiplication [ - | product expected | - product := 2 * (PMPolynomial coefficients: #( 2 -3 1 )). - + | product expected p | + p := PMPolynomial coefficients: #( 2 -3 1 ). + product := 2 * p. + expected := PMPolynomial coefficients: #( 4 -6 2 ). self assert: product equals: expected ] @@ -223,9 +224,10 @@ PMPolynomialTest >> testPolynomialNumberMultiplication [ { #category : #'testing - multiplication' } PMPolynomialTest >> testPolynomialNumberMultiplicationInverse [ - | product expected | - product := (PMPolynomial coefficients: #( 2 -3 1 )) * 2. - + | product expected p | + p := PMPolynomial coefficients: #( 2 -3 1 ). + product := p * 2. + expected := PMPolynomial coefficients: #( 4 -6 2 ). self assert: product equals: expected ]