Skip to content

Commit

Permalink
refactor: replaced equating coefficients with equating Polynomials.
Browse files Browse the repository at this point in the history
  • Loading branch information
hemalvarambhia committed Dec 27, 2023
1 parent 84b6af9 commit aaefdcf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Math-Tests-Polynomials/PMPolynomialTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand Down

0 comments on commit aaefdcf

Please sign in to comment.