RegressionTests__ContextTest2.st
changeset 654 fbf6fc76b0fa
parent 252 1005bdeab488
child 669 2d182f7b5258
--- a/RegressionTests__ContextTest2.st	Wed Jan 18 12:11:28 2012 +0100
+++ b/RegressionTests__ContextTest2.st	Wed Mar 07 13:19:22 2012 +0100
@@ -63,6 +63,16 @@
     ^ ttt sender sender
 !
 
+callRecursive: level withArg:argument thenDo:aBlock
+    level == 0 ifTrue:[
+        aBlock value:thisContext.
+        ^ self.
+    ].
+    self callRecursive:level-1 withArg:argument thenDo:aBlock
+
+    "Created: / 07-03-2012 / 13:04:48 / cg"
+!
+
 downToNextSegmentThenDo:aBlock
     self
 	downToSegment:(Processor activeProcess numberOfStackSegments + 1)
@@ -294,6 +304,29 @@
     "
 !
 
+testDisplayString1
+    "the generated displayString must be a string (even if one of the args or receiver
+     is a Twobytestring"
+
+    Transcript showCR:'1'.
+    self 
+        callRecursive:3
+        withArg:((Unicode16String new:2)
+                                at:1 put:(Character value:16r151);
+                                at:2 put:(Character value:16rFF00);
+                                yourself)
+        thenDo:[:context | 
+                    self assert:(context displayString bitsPerCharacter == 8).
+                    self assert:(context fullPrintString bitsPerCharacter == 8).
+               ].
+
+    "
+     self new testDisplayString1
+    "
+
+    "Created: / 07-03-2012 / 13:03:32 / cg"
+!
+
 testProcess1
     |x set lockSet p arg|