Skip to content

Commit

Permalink
refactor: we can use the Polynomial's = method to reduce the number o…
Browse files Browse the repository at this point in the history
…f assertions and make the tests more DSL like.
  • Loading branch information
hemalvarambhia committed Dec 27, 2023
1 parent 4b0e6ce commit c56bdc1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Math-Tests-Polynomials/PMPolynomialTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ PMPolynomialTest >> testPolynomialMultiplicationIsCommutative [

{ #category : #'testing - addition' }
PMPolynomialTest >> testPolynomialNumberAddition [
| polynomial |
polynomial := 2 + (PMPolynomial coefficients: #(2 -3 1)).
self assert: (polynomial at: 0) equals: 4.
self assert: (polynomial at: 1) equals: -3.
self assert: (polynomial at: 2) equals: 1.

| polynomial expected |
polynomial := 2 + (PMPolynomial coefficients: #( 2 -3 1 )).
expected := PMPolynomial coefficients: #( 4 -3 1 ).
self assert: polynomial equals: expected.
self assert: (polynomial at: 3) equals: 0
]

Expand Down

0 comments on commit c56bdc1

Please sign in to comment.