diff -r baa58c703a71 -r 08178a40c828 RegressionTests__DelayTest.st --- a/RegressionTests__DelayTest.st Thu May 24 00:21:24 2001 +0200 +++ b/RegressionTests__DelayTest.st Thu May 24 00:36:05 2001 +0200 @@ -1,17 +1,16 @@ "{ Package: 'exept:regression' }" - + "{ NameSpace: RegressionTests }" - -Object subclass:#DelayTest - instanceVariableNames:'' - classVariableNames:'' - poolDictionaries:'' - category:'Tests-Regression' + +TestCase subclass:#DelayTest + instanceVariableNames:'' + classVariableNames:'' + poolDictionaries:'' + category:'Tests-Regression' ! - - -!DelayTest class methodsFor:'tests'! - + +!DelayTest methodsFor:'tests'! + test1 |n| @@ -22,5 +21,41 @@ Transcript showCR:n. n := n + 1. ] - ] forkAt:9. + ] forkAt:(Processor activePriority - 1). + + self assert:(n == nil). + + Delay waitForSeconds:1. + + self assert:(n == 0). + + Delay waitForSeconds:15. + + self assert:(n == 10). + + " + self basicNew test1 + " +! + +test2 + |n| + + [ + n := 0. + [n < 10] whileTrue:[ + Delay waitForSeconds:1. + Transcript showCR:n. + n := n + 1. + ] + ] forkAt:(Processor activePriority + 1). + + self assert:(n == 0). + Delay waitForSeconds:11. + self assert:(n == 10). + + " + self basicNew test2 + " ! ! +