From aaefdcfca1668903e2418dc1ed957a33977b3063 Mon Sep 17 00:00:00 2001 From: hemalvarambhia Date: Wed, 27 Dec 2023 19:33:44 +0000 Subject: [PATCH] refactor: replaced equating coefficients with equating Polynomials. --- src/Math-Tests-Polynomials/PMPolynomialTest.class.st | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Math-Tests-Polynomials/PMPolynomialTest.class.st b/src/Math-Tests-Polynomials/PMPolynomialTest.class.st index 89a0fcbb..923c3fb4 100644 --- a/src/Math-Tests-Polynomials/PMPolynomialTest.class.st +++ b/src/Math-Tests-Polynomials/PMPolynomialTest.class.st @@ -295,14 +295,12 @@ PMPolynomialTest >> testPolynomialRootsForLinear [ { #category : #'testing - subtraction' } PMPolynomialTest >> testPolynomialSubtraction [ - | polynomial p q | + | polynomial p q expected | p := PMPolynomial coefficients: #( 2 -3 1 ). q := PMPolynomial coefficients: #( -3 7 2 1 ). polynomial := p - q. - self assert: (polynomial at: 0) equals: 5. - self assert: (polynomial at: 1) equals: -10. - self assert: (polynomial at: 2) equals: -1. - self assert: (polynomial at: 3) equals: -1. + expected := PMPolynomial coefficients: #( 5 -10 -1 -1 ). + self assert: polynomial equals: expected. self assert: (polynomial at: 4) equals: 0 ]