[squeak-dev] The Trunk: KernelTests-ct.437.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Nov 7 19:52:35 UTC 2022
Christoph Thiede uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-ct.437.mcz
==================== Summary ====================
Name: KernelTests-ct.437
Author: ct
Time: 7 November 2022, 8:51:49.281226 pm
UUID: fc0ce7a3-e562-e741-a923-d825e2ff3b4e
Ancestors: KernelTests-jar.436, KernelTests-ct.374
Merges KernelTests-ct.374:
Tests #haltOnce and #haltOnceIf:. Refactors tests for #haltIf:. Complements Kernel-ct.1294.
Revision:
Minor refactoring.
=============== Diff against KernelTests-jar.436 ===============
Item was added:
+ ----- Method: ObjectTest>>resetHaltOnceAfter: (in category 'running') -----
+ resetHaltOnceAfter: aBlock
+
+ | outerState |
+ outerState := self haltOnceEnabled.
+ ^ aBlock ensure: [
+ outerState
+ ifTrue: [self setHaltOnce]
+ ifFalse: [self clearHaltOnce] ]!
Item was added:
+ ----- Method: ObjectTest>>shouldHalt: (in category 'asserting') -----
+ shouldHalt: aBlock
+
+ ^ self
+ should: aBlock
+ raise: Halt!
Item was added:
+ ----- Method: ObjectTest>>shouldntHalt: (in category 'asserting') -----
+ shouldntHalt: aBlock
+
+ ^ self
+ shouldnt: aBlock
+ raise: Halt!
Item was changed:
+ ----- Method: ObjectTest>>testHaltIf (in category 'tests - debugging') -----
- ----- Method: ObjectTest>>testHaltIf (in category 'tests - testing') -----
testHaltIf
+ self shouldHalt: [self haltIf: true].
+ self shouldntHalt: [self haltIf: false].
+
+ self shouldHalt: [self haltIf: [true]].
+ self shouldntHalt: [self haltIf: [false]].
+
+ self shouldHalt: [self haltIf: #testHaltIf].
+ self shouldntHalt: [self haltIf: #teadfasdfltIf].
+
+ self shouldHalt: [self a].
+ self shouldntHalt: [self a1].
+
+ self shouldHalt: [self haltIf: [:o | o class = self class]].
+ self shouldntHalt: [self haltIf: [:o | o class ~= self class]].!
- self should: [self haltIf: true] raise: Halt.
- self haltIf: false.
-
- self should: [self haltIf: [true]] raise: Halt.
- self haltIf: [false].
-
- self should: [self haltIf: #testHaltIf.] raise: Halt.
- self haltIf: #teadfasdfltIf.
-
- self should: [self a] raise: Halt.
- self a1.
-
- self should: [self haltIf: [:o | o class = self class]] raise: Halt.
- self haltIf: [:o | o class ~= self class].
- !
Item was added:
+ ----- Method: ObjectTest>>testHaltOnce (in category 'tests - debugging') -----
+ testHaltOnce
+
+ self resetHaltOnceAfter: [
+ self setHaltOnce.
+ self assert: [self haltOnceEnabled].
+ self shouldHalt: [self haltOnce].
+ self deny: [self haltOnceEnabled].
+ self shouldntHalt: [self haltOnce].
+
+ self setHaltOnce.
+ self assert: [self haltOnceEnabled].
+ self clearHaltOnce.
+ self deny: [self haltOnceEnabled].
+ self shouldntHalt: [self haltOnce]].!
Item was added:
+ ----- Method: ObjectTest>>testHaltOnceIf (in category 'tests - debugging') -----
+ testHaltOnceIf
+
+ self resetHaltOnceAfter: [
+ | tested |
+ self setHaltOnce.
+ self shouldHalt: [self haltOnceIf: true].
+ self shouldntHalt: [self haltOnceIf: true].
+
+ self setHaltOnce.
+ self shouldntHalt: [self haltOnceIf: false].
+ self assert: [self haltOnceEnabled].
+
+ self setHaltOnce.
+ tested := false.
+ self shouldHalt: [self haltOnceIf: [tested := true]].
+ self assert: tested.
+ tested := false.
+ self shouldntHalt: [self haltOnceIf: [tested := true]].
+ self deny: tested.
+
+ self setHaltOnce.
+ tested := false.
+ self shouldntHalt: [self haltOnceIf: [(tested := true) not]].
+ self assert: [self haltOnceEnabled].
+ self assert: tested.
+ tested := false.
+ self shouldntHalt: [self haltOnceIf: [(tested := true) not]].
+ self assert: [self haltOnceEnabled].
+ self assert: tested].!
Item was changed:
+ ----- Method: ObjectTest>>testNotNil (in category 'tests - debugging') -----
- ----- Method: ObjectTest>>testNotNil (in category 'tests - testing') -----
testNotNil
self assert: Object new notNil!
More information about the Squeak-dev
mailing list
|