RegressionTests__BlockTest.st
changeset 97 7acb21a8e40c
parent 95 362e58ff28ba
child 181 a56517005229
--- a/RegressionTests__BlockTest.st	Thu Dec 07 09:49:14 2000 +0100
+++ b/RegressionTests__BlockTest.st	Thu Dec 07 10:57:18 2000 +0100
@@ -12,6 +12,16 @@
 
 !BlockTest methodsFor:'varArgBlocks'!
 
+getBlock1
+     |b|
+
+     b := [:arg | Transcript 
+                        show:'invoked with arg:'; 
+                        showCR:arg
+          ].
+     ^ b
+!
+
 getVarArgBlock1
      |b|
 
@@ -50,6 +60,32 @@
 
 !
 
+testBlock1
+    |b|
+
+    b := self getBlock1.
+
+    b code notNil ifTrue:[
+        Transcript showCR:'before call: *** blocks code is jitted'
+    ] ifFalse:[
+        Transcript showCR:'before call: blocks code is NOT jitted'
+    ].
+    b value:nil.
+    b code notNil ifTrue:[
+        Transcript showCR:'after call: blocks code is jitted'
+    ] ifFalse:[
+        Transcript showCR:'after call: *** blocks code is NOT jitted'
+    ].
+
+    b value:#foo.
+    b value:1.
+    b value:2
+
+    "
+     self new testBlock1
+    "
+!
+
 testVarArgBlock1
     |b|