Skip to content

Commit

Permalink
refactor: extract temp so we can show the computation being tested cl…
Browse files Browse the repository at this point in the history
…early.
  • Loading branch information
hemalvarambhia committed Dec 27, 2023
1 parent 1d08970 commit 84b6af9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Math-Tests-Polynomials/PMPolynomialTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,11 @@ PMPolynomialTest >> testPolynomialRootsForLinear [

{ #category : #'testing - subtraction' }
PMPolynomialTest >> testPolynomialSubtraction [
| polynomial |
polynomial := (PMPolynomial coefficients: #(2 -3 1))
- (PMPolynomial coefficients: #(-3 7 2 1)).

| polynomial p q |
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.
Expand Down

0 comments on commit 84b6af9

Please sign in to comment.