The Trunk: MultilingualTests-tonyg.22.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: MultilingualTests-tonyg.22.mcz

commits-2
Patrick Rein uploaded a new version of MultilingualTests to project The Trunk:
http://source.squeak.org/trunk/MultilingualTests-tonyg.22.mcz

==================== Summary ====================

Name: MultilingualTests-tonyg.22
Author: tonyg
Time: 23 February 2017, 2:01:47.977527 pm
UUID: 76769ce3-a15d-46a7-acbd-8acfbd56fcc9
Ancestors: MultilingualTests-pre.21

Test cases from Mantis #4665.

=============== Diff against MultilingualTests-pre.21 ===============

Item was added:
+ ----- Method: MultiByteFileStreamTest>>testUpToAllAscii (in category 'testing') -----
+ testUpToAllAscii
+ "This test case is inspired by Mantis #4665."
+ "Compare to testUpToAllUtf."
+
+ | in out fn resultA resultB |
+ fn :='testUpToAll.in'.
+ out := FileDirectory default forceNewFileNamed: fn.
+ out nextPutAll: 'A<'. "Encodes to byte sequence 413C"
+ out close.
+
+ in := FileDirectory default readOnlyFileNamed: fn.
+ resultA := in upToAll: '<'.
+ in close.
+
+ in := FileDirectory default readOnlyFileNamed: fn.
+ resultB := in upTo: $<.
+ in close.
+
+ self assert: resultA = resultB
+ !

Item was added:
+ ----- Method: MultiByteFileStreamTest>>testUpToAllUtf (in category 'testing') -----
+ testUpToAllUtf
+ "This test case is adapted from Mantis #4665."
+ "MultiByteFileStream was relying on PositionableStream>>#match: to discover the position immediately following the delimiter collection. It would then use #next: to retrieve a number of *characters* computed as the difference in stream positions. However, stream positions are measured in *bytes*, not characters, so this would lead to misalignment when the skipped text included UTF-8 encoded characters."
+
+ | in out fn resultA resultB |
+ fn :='testUpToAll.in'.
+ out := FileDirectory default forceNewFileNamed: fn.
+ out nextPutAll: 231 asCharacter asString, '<'. "Encodes to byte sequence C3A73C"
+ out close.
+
+ in := FileDirectory default readOnlyFileNamed: fn.
+ resultA := in upToAll: '<'.
+ in close.
+
+ in := FileDirectory default readOnlyFileNamed: fn.
+ resultB := in upTo: $<.
+ in close.
+
+ self assert: resultA = resultB
+ !