Skip to content

Commit 25ba113

Browse files
test: clarified naming using domain language (repeated roots).
1 parent 22e219c commit 25ba113

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/Math-Tests-Polynomials/PMPolynomialTest.class.st

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,17 +264,6 @@ PMPolynomialTest >> testPolynomialRootsForLinear [
264264
self assert: (roots at: 1) closeTo: -0.5 .
265265
]
266266

267-
{ #category : #'iterative algorithms' }
268-
PMPolynomialTest >> testPolynomialRootsForQuadratic [
269-
| polynomial roots |
270-
"Here, compute the roots of the quadratic (2x + 1)^2 = 4 x^2 + 4 x + 1"
271-
polynomial := PMPolynomial coefficients: #(1 4 4).
272-
roots := polynomial roots .
273-
self assert: roots size equals: 2.
274-
self assert: (roots at: 1) closeTo: -0.5 .
275-
self assert: (roots at: 2) closeTo: -0.5 .
276-
]
277-
278267
{ #category : #'function evaluation' }
279268
PMPolynomialTest >> testPolynomialSubtraction [
280269
| polynomial |
@@ -286,3 +275,14 @@ PMPolynomialTest >> testPolynomialSubtraction [
286275
self assert: (polynomial at: 3) equals: -1.
287276
self assert: (polynomial at: 4) equals: 0
288277
]
278+
279+
{ #category : #'iterative algorithms' }
280+
PMPolynomialTest >> testPolynomialWithRepeatedRoots [
281+
| polynomial roots |
282+
"Here, compute the roots of the quadratic (2x + 1)^2 = 4 x^2 + 4 x + 1"
283+
polynomial := PMPolynomial coefficients: #(1 4 4).
284+
roots := polynomial roots .
285+
self assert: roots size equals: 2.
286+
self assert: (roots at: 1) closeTo: -0.5 .
287+
self assert: (roots at: 2) closeTo: -0.5 .
288+
]

0 commit comments

Comments
 (0)