Skip to content

Commit

Permalink
Issue #79: added new test ZnCharacterStreamTests >> testUtf8EncodingS…
Browse files Browse the repository at this point in the history
…treamPosition to illustrate what I think should be a bug
  • Loading branch information
dalehenrich committed Dec 11, 2022
1 parent 762fd3f commit 6115ecb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/Zinc-Character-Encoding-Tests/ZnCharacterStreamTests.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ ZnCharacterStreamTests >> assertUpTo: array [
ZnCharacterStreamTests >> assertUpToAll: array [
| encodingStream |
self assert: (array first readStream upToAll: array second) equals: array third.
encodingStream := self utf8ReadStreamOn: array first .
self assert: (encodingStream upToAll: array second) equals: array third.
encodingStream := self eightBitReadStreamOn: array first.
self assert: (encodingStream upToAll: array second) equals: array third.
encodingStream := self utf8ReadStreamOn: array first .
self assert: (encodingStream upToAll: array second) equals: array third.

]

{ #category : 'testing' }
Expand Down Expand Up @@ -135,6 +136,18 @@ ZnCharacterStreamTests >> testSimpleUTF8WriteStream [
equals: bytes asByteArray
]

{ #category : 'testing' }
ZnCharacterStreamTests >> testUtf8EncodingStreamPosition [
| string bytes stream res |
string := 'eißendeße'.
bytes := ZnUTF8Encoder new encodeString: string.
stream := (ZnCharacterReadStream on: bytes readStreamPortable).
res := stream next; next; next.
self assert: res equals: $ß.
self assert: stream halt position equals: 3.

]

{ #category : 'testing' }
ZnCharacterStreamTests >> testUpTo [
| char1 char2 string1 string2 |
Expand Down

0 comments on commit 6115ecb

Please sign in to comment.