Skip to content

Commit

Permalink
Issue #75: the current set of failing tests (for ZnUnicodeCharacterSt…
Browse files Browse the repository at this point in the history
…reamTests and ZnLegacyCharacterStreamTests: testUpToAll, testUpToAllTwice and testUtf8EncodingStreamPositionFor...) are all apparently due to Issue #80
  • Loading branch information
dalehenrich committed Dec 14, 2022
1 parent f88a0a7 commit 9e50db4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ ZnBufferedReadStream >> closed [
ZnBufferedReadStream >> collectionSpecies [
^ stream isBinary
ifTrue: [ ByteArray ]
ifFalse: [ stream stringClass ]
ifFalse: [
(stream respondsTo: #'stringClass')
ifTrue: [ stream stringClass ]
ifFalse: [
String isInUnicodeComparisonMode
ifTrue: [ Unicode7 ]
ifFalse: [ String ] ] ]
]

{ #category : 'accessing' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,19 +309,21 @@ ZnAbstractCharacterStreamTests >> testUpToAll [

{ #category : 'testing' }
ZnAbstractCharacterStreamTests >> testUpToAllTwice [
| string utf8Stream stream eightBitStream a b |
| string utf8Stream stream eightBitStream a b use8BitStream |

string := self convertStringToStringClass: 'eißendeße'.
use8BitStream := {String . Unicode7} includes: string class.

stream := string readStreamPortable.
eightBitStream := self eightBitReadStreamOn: string.
use8BitStream ifTrue: [ eightBitStream := self eightBitReadStreamOn: string ].
utf8Stream := self utf8ReadStreamOn: string.

self assert: (stream upToAll: (self convertStringToStringClass: 'ße')) equals: (self convertStringToStringClass: 'ei').
self assert: (eightBitStream upToAll: (self convertStringToStringClass: 'ße')) equals: (self convertStringToStringClass: 'ei').
use8BitStream ifTrue: [ self assert: (eightBitStream upToAll: (self convertStringToStringClass: 'ße')) equals: (self convertStringToStringClass: 'ei') ].
self assert: (utf8Stream upToAll: (self convertStringToStringClass:'ße')) equals: (self convertStringToStringClass: 'ei').

self assert: (stream upToAll: (self convertStringToStringClass:'ße')) equals: (self convertStringToStringClass: 'nde').
self assert: (eightBitStream upToAll: (self convertStringToStringClass:'ße')) equals: (self convertStringToStringClass: 'nde').
use8BitStream ifTrue: [ self assert: (eightBitStream upToAll: (self convertStringToStringClass:'ße')) equals: (self convertStringToStringClass: 'nde') ].
self assert: (utf8Stream upToAll: (self convertStringToStringClass:'ße')) equals: (self convertStringToStringClass: 'nde').

a := (self convertStringToStringClass: 'ABC'), (Character codePoint: 128), (Character codePoint: 255).
Expand Down

0 comments on commit 9e50db4

Please sign in to comment.