--- a/RegressionTests__StreamTests.st Wed Mar 27 18:34:04 2019 +0100
+++ b/RegressionTests__StreamTests.st Thu Mar 28 00:20:16 2019 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
"{ Package: 'stx:goodies/regression' }"
"{ NameSpace: RegressionTests }"
@@ -937,6 +935,66 @@
"
"Created: / 27-03-2019 / 14:44:14 / Claus Gittinger"
+!
+
+test52_skipThroughAll
+ |s|
+
+ "0123456789012345678901"
+ {
+ '0123456789012345678901' .
+ '0123456789012345678901' asUnicode16String .
+ '0123456789012345678901' asUnicode32String .
+ } do:[:eachInput |
+ s := eachInput readStream.
+ self assert:(s position == 0).
+ s skipThroughAll:'901'.
+ self assert:(s peek == $2).
+ self assert:(s position == 12).
+
+ s skipThroughAll:'901'.
+ self assert:(s peek isNil).
+ self assert:(s atEnd).
+ self assert:(s position == 22).
+ ].
+
+ "0123456789012345678901"
+ {
+ '0123456789012345678901' asArray.
+ } do:[:eachInput |
+ s := eachInput readStream.
+ self assert:(s position == 0).
+ s skipThroughAll:'901' asArray.
+ self assert:(s peek == $2).
+ self assert:(s position == 12).
+
+ s skipThroughAll:'901' asArray.
+ self assert:(s peek isNil).
+ self assert:(s atEnd).
+ self assert:(s position == 22).
+ ].
+
+ s := ReadStream on:'12345678901234567890a'.
+ s skipThroughAll:'90ab'.
+ self assert:(s atEnd).
+ self assert:(s upToEnd = '').
+
+ s := ReadStream on:'12345678901234567890'.
+ s skipThroughAll:'901'.
+ self assert:(s upToEnd = '234567890').
+
+ s := ReadStream on:'12345678901234567890'.
+ s skipThroughAll:'1234'.
+ self assert:(s upToEnd = '5678901234567890').
+
+ s := ReadStream on:'12345678901234567890'.
+ s skipThroughAll:'999'.
+ self assert:s atEnd.
+
+ "
+ self run:#test52_skipThroughAll
+ self new test52_skipThroughAll
+ "
! !
!StreamTests class methodsFor:'documentation'!