Skip to content

Commit

Permalink
tests: make #testDebugForks safe for test coverage
Browse files Browse the repository at this point in the history
cherry-picked from 3ead617 & 137e6bd
  • Loading branch information
LinqLover committed Dec 27, 2023
1 parent 1c6f981 commit 7d7b92e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
private
stepContextIgnoringCoverage: aContext

| context |
context := aContext step.

[context selector == #run:with:in:] whileTrue:
[| contextAndError |
contextAndError := context runUntilErrorOrReturnFrom: context.
self assert: contextAndError second isNil.
context := contextAndError first].

^ context
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"memoryClass" : "ct 5/10/2022 21:50",
"newSimulator" : "ct 5/10/2022 21:54",
"setUp" : "ct 5/26/2022 15:38",
"stepContextIgnoringCoverage:" : "ct 11/26/2022 19:27",
"testConsArray" : "ct 5/28/2022 19:43",
"testContextPrimitives" : "ct 7/3/2022 01:53",
"testExecuteQuickMethod" : "ct 7/1/2022 18:49",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ testDebugForks

| context |
context := simulator customize:
[(thisContext tdbRetracingTimeIndex + 1 // 2) even ifFalse: [thisContext tdbRetracingTimeIndex]] asContext.
[context willJumpIfFalse] whileFalse: [context := context step].
[(thisContext tdbRetracingTimeIndex + 1 // 2) even
ifFalse: [thisContext tdbRetracingTimeIndex]] asContext.
[context willJumpIfFalse] whileFalse:
[context := self stepContextIgnoringCoverage: context].

[context := context step]
valueSupplyingAnswer: #('*fork*' 2).

[context willReturn] whileFalse: [context := context step].
[context willReturn] whileFalse:
[context := self stepContextIgnoringCoverage: context].
self assertSlice: context top times: {1 to: 1. 2 to: 2} values: {1. 2}.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"testCombineArgumentsCollect" : "ct 6/2/2022 10:28",
"testContextPrimitives" : "ct 9/14/2022 12:11",
"testCutVectorFromSideEffect" : "ct 7/7/2022 16:44",
"testDebugForks" : "ct 6/2/2022 10:27",
"testDebugForks" : "ct 11/26/2022 19:10",
"testError" : "ct 6/2/2022 10:41",
"testIsolateState" : "ct 5/26/2022 15:45",
"testIsolatedForks" : "ct 5/26/2022 20:04",
Expand Down

0 comments on commit 7d7b92e

Please sign in to comment.