RegressionTests__IndentStreamTest.st
changeset 1979 69cd18d16f05
parent 1978 0ac513a7e77d
child 1980 be2895006916
--- a/RegressionTests__IndentStreamTest.st	Sun Jul 01 10:21:34 2018 +0200
+++ b/RegressionTests__IndentStreamTest.st	Sun Jul 01 10:28:54 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:goodies/regression' }"
 
 "{ NameSpace: RegressionTests }"
@@ -10,7 +12,7 @@
 !
 
 
-!IndentStreamTest methodsFor:'as yet unclassified'!
+!IndentStreamTest methodsFor:'tests'!
 
 testConstructors
 
@@ -20,6 +22,35 @@
     "Modified: / 01-07-2018 / 10:12:07 / Claus Gittinger"
 !
 
+testGeneratedOutput
+        | stream |
+        stream := IndentStream on: ''.
+        stream nextPutLine:'line1'.
+        stream indent.
+        stream nextPutLine:'line2a'.
+        stream nextPutLine:'line2b'.
+        stream indent.
+        stream nextPutLine:'line3a'.
+        stream nextPutAll:'line3b'.
+        stream indentBack; cr.
+        stream nextPutLine:'line4a'.
+        stream nextPutAll:'line4b'.
+        stream indentBack; cr.
+        stream nextPutLine:'line5'.
+        self assert:stream contents =
+'line1
+\tline2a
+\tline2b
+\t\tline3a
+\t\tline3b
+\tline4a
+\tline4b
+line5
+' withoutCEscapes
+
+    "Created: / 01-07-2018 / 10:23:56 / Claus Gittinger"
+!
+
 testIndent
 
         | stream |