Skip to content

Commit 6edda9f

Browse files
Formatted the tests to follow arrange act assert.
1 parent d2905e9 commit 6edda9f

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/Math-Tests-Complex/PMComplexTest.class.st

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -619,11 +619,15 @@ PMComplexTest >> testSinh [
619619

620620
{ #category : #tests }
621621
PMComplexTest >> testSquareRootOfANegativeRealNumberIsPureImaginary [
622+
622623
"Given z = -4 + 0 i, the square root is 2 i"
623-
624-
| squareRoot |
625-
squareRoot := (PMComplex real: -4 imaginary: 0) sqrt .
626-
self assert: squareRoot equals: 2 i.
624+
625+
| squareRoot z |
626+
z := PMComplex real: -4 imaginary: 0.
627+
628+
squareRoot := z sqrt.
629+
630+
self assert: squareRoot equals: 2 i
627631
]
628632

629633
{ #category : #tests }
@@ -670,10 +674,12 @@ PMComplexTest >> testSquareRootOfPositiveRealNumberIsAComplexNumberWithOnlyAReal
670674

671675
"Given z = 6 + 0 i, then root z = root 6"
672676

673-
| squareRoot expected |
674-
squareRoot := (PMComplex real: 6 imaginary: 0) sqrt.
677+
| squareRoot expected positiveRealNumber |
678+
positiveRealNumber := PMComplex real: 6 imaginary: 0.
675679

676-
expected := PMComplex real: (6 sqrt) imaginary: 0.
680+
squareRoot := positiveRealNumber sqrt.
681+
682+
expected := PMComplex real: 6 sqrt imaginary: 0.
677683
self assert: squareRoot equals: expected
678684
]
679685

0 commit comments

Comments
 (0)