RegressionTests__StreamTests.st
changeset 1897 b5268e1fe140
parent 1555 2089b49b4f94
child 2165 1fc8dd893e6c
equal deleted inserted replaced
1896:3bca39f52288 1897:b5268e1fe140
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "{ Package: 'stx:goodies/regression' }"
     3 "{ Package: 'stx:goodies/regression' }"
     2 
     4 
     3 "{ NameSpace: RegressionTests }"
     5 "{ NameSpace: RegressionTests }"
     4 
     6 
     5 TestCase subclass:#StreamTests
     7 TestCase subclass:#StreamTests
   721      self run:#test40_eolMode
   723      self run:#test40_eolMode
   722      self new test40_eolMode
   724      self new test40_eolMode
   723     "
   725     "
   724 
   726 
   725     "Modified: / 06-12-2016 / 14:25:11 / cg"
   727     "Modified: / 06-12-2016 / 14:25:11 / cg"
       
   728 !
       
   729 
       
   730 test50_skipThrough
       
   731     |s|
       
   732 
       
   733          "0123456789012345678901"
       
   734     s := '0123456789012345678901' readStream.
       
   735     self assert:(s position == 0).
       
   736     s skipThrough:$0.
       
   737     self assert:(s peek == $1).
       
   738     self assert:(s position == 1).
       
   739 
       
   740     s skipThrough:$0.
       
   741     self assert:(s peek == $1).
       
   742     self assert:(s position == 11).
       
   743 
       
   744     s skipThrough:$0.
       
   745     self assert:(s peek == $1).
       
   746     self assert:(s position == 21).
       
   747 
       
   748     s := 'bla { foo }' readStream.
       
   749     s skipThrough:${.
       
   750     self assert:(s peek == $ ).
       
   751     s skipThrough:$}.
       
   752     self assert:(s atEnd).
       
   753 
       
   754     "
       
   755      self run:#test50_skipThrough
       
   756      self new test50_skipThrough
       
   757     "
   726 ! !
   758 ! !
   727 
   759 
   728 !StreamTests class methodsFor:'documentation'!
   760 !StreamTests class methodsFor:'documentation'!
   729 
   761 
   730 version
   762 version