Skip to content

Commit 5a678e0

Browse files
committedFeb 18, 2025·
Improve ifNil-related tests
- make test less ambiguous around semantics of receiver being returned from Object>>#ifNil: - change order to make the output of exected and actual match Signed-off-by: Stefan Marr <[email protected]>
1 parent 7f73422 commit 5a678e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎TestSuite/BooleanTest.som

+6-6
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,21 @@ BooleanTest = TestCase (
161161
self assert: (nil ifNil: [ true ]).
162162
self deny: (nil ifNil: [ false ]).
163163

164-
self assert: (self ifNil: [ #notExec ]) is: self.
165-
self assert: (self ifNil: [ #notExec ]) is: self.
164+
self assert: #rcvr is: (#rcvr ifNil: [ #notExec ]).
165+
self assert: #rcvr is: (#rcvr ifNil: [ #notExec ]).
166166
)
167167

168168
testIfNotNil = (
169169
self assert: (self ifNotNil: [ true ]).
170170
self deny: (self ifNotNil: [ false ]).
171171

172-
self assert: (nil ifNotNil: [ #notExec ]) is: nil.
173-
self assert: (nil ifNotNil: [ #notExec ]) is: nil.
172+
self assert: nil is: (nil ifNotNil: [ #notExec ]).
173+
self assert: nil is: (nil ifNotNil: [ #notExec ]).
174174
)
175175

176176
testIfNilIfNotNil = (
177-
self assert: (nil ifNil: [ #exec ] ifNotNil: [ #notExec ]) is: #exec.
178-
self assert: (self ifNil: [ #notExec ] ifNotNil: [ #exec ]) is: #exec.
177+
self assert: #exec is: (nil ifNil: [ #exec ] ifNotNil: [ #notExec ]).
178+
self assert: #exec is: (self ifNil: [ #notExec ] ifNotNil: [ #exec ]).
179179
)
180180

181181
testIfNotNilIfNil = (

0 commit comments

Comments
 (0)
Please sign in to comment.