The Trunk: MultilingualTests-pre.26.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-pre.26.mcz

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

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

Name: MultilingualTests-pre.26
Author: pre
Time: 31 August 2017, 3:17:33.9894 pm
UUID: 6916746b-6a8d-734a-8457-6d2af090fe4b
Ancestors: MultilingualTests-pre.25, MultilingualTests-tonyg.22

Merges MultilingualTests-tonyg.22 which tests a fix for Mantis #4665 and deals with the difference in counting at the public interface of streams and counting the steps in the underlying buffer.

=============== Diff against MultilingualTests-pre.25 ===============

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
+ !