Skip to content

Commit

Permalink
refactor: Extract Variable so we can demonstrate the operation being …
Browse files Browse the repository at this point in the history
…tested clearly.
  • Loading branch information
hemalvarambhia committed Dec 27, 2023
1 parent 75c2fd8 commit d4fed03
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Math-Tests-Polynomials/PMPolynomialTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,21 @@ 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
]

{ #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
]
Expand Down

0 comments on commit d4fed03

Please sign in to comment.