#QUALITY by cg expecco_2_9_0 expecco_2_9_0_win75_lx36 expecco_2_9_1
authorClaus Gittinger <cg@exept.de>
Fri, 22 Apr 2016 15:38:43 +0200
changeset 1401 f21e33b07c13
parent 1400 3ba502e13bff
child 1402 5e7b9b681064
#QUALITY by cg class: RegressionTests::StreamTests added: #test22_readWriteStreamWithRewrite
RegressionTests__StreamTests.st
--- a/RegressionTests__StreamTests.st	Fri Apr 22 15:35:47 2016 +0200
+++ b/RegressionTests__StreamTests.st	Fri Apr 22 15:38:43 2016 +0200
@@ -453,6 +453,33 @@
     "
 !
 
+test22_readWriteStreamWithRewrite
+    |s|
+
+         "0123456789012345678901"
+    s := ReadWriteStream on:(String new).
+    self assert:(s position == 0).
+    self assert:(s readLimit == 0).
+
+    s nextPutAll:'hello world'.
+    self assert:(s position == 11).
+    self assert:(s readLimit == 11).
+
+    s position:(s position - 5).
+    self assert:(s position = 6).
+    s nextPutAll:'W'.
+    
+    self assert:(s position = 7).
+    self assert:(s readLimit = 11).
+    self assert:(s contents = 'hello World').
+
+    
+    "
+     self run:#test22_readWriteStreamWithRewrite
+     self new test21_readWriteStreamWithPosition
+    "
+!
+
 test30_readWriteBinary
     |testVector s val|