`EncodedStream`: add assertion
...to ensure we're not creating encoded stream atop of another encoded stream
--- a/EncodedStream.st Thu Jul 09 22:41:21 2020 +0100
+++ b/EncodedStream.st Mon Jul 20 15:37:58 2020 +0100
@@ -1,8 +1,7 @@
-"{ Encoding: utf8 }"
-
"
COPYRIGHT (c) 2004 by eXept Software AG
COPYRIGHT (c) 2010 Jan Vrany
+ COPYRIGHT (c) 2020 LabWare
All Rights Reserved
This software is furnished under a license and may be used
@@ -29,6 +28,7 @@
"
COPYRIGHT (c) 2004 by eXept Software AG
COPYRIGHT (c) 2010 Jan Vrany
+ COPYRIGHT (c) 2020 LabWare
All Rights Reserved
This software is furnished under a license and may be used
@@ -57,7 +57,7 @@
"
|s|
s := EncodedStream stream:Transcript encoder:(CharacterEncoder encoderToEncodeFrom:#utf8 into:#unicode).
- s nextPutAll:('öäü' utf8Encoded)
+ s nextPutAll:('öäü' utf8Encoded)
"
!
@@ -68,7 +68,7 @@
|baseStream s|
baseStream := '' readWriteStream.
s := EncodedStream stream:baseStream encoding:#utf8.
- s nextPutAll:'öäü'.
+ s nextPutAll:'öäü'.
baseStream reset; contents.
"
! !
@@ -179,8 +179,11 @@
^ stream
!
-stream:something
- stream := something.
+stream:aStream
+ self assert: aStream isEncodedStream not.
+ stream := aStream.
+
+ "Modified: / 20-07-2020 / 15:36:54 / Jan Vrany <jan.vrany@labware.com>"
! !
!EncodedStream methodsFor:'private fileIn'!
@@ -606,6 +609,11 @@
^ '$Header$'
!
+version_HG
+
+ ^ '$Changeset: <not expanded> $'
+!
+
version_SVN
^ '$ Id: EncodedStream.st 10643 2011-06-08 21:53:07Z vranyj1 $'
! !