[squeak-dev] The Trunk: MultilingualTests-mt.42.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 5 13:15:33 UTC 2022


Marcel Taeumel uploaded a new version of MultilingualTests to project The Trunk:
http://source.squeak.org/trunk/MultilingualTests-mt.42.mcz

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

Name: MultilingualTests-mt.42
Author: mt
Time: 5 April 2022, 3:15:31.575397 pm
UUID: 255b0130-5a2b-4cb6-8c3b-9799e047dcb0
Ancestors: MultilingualTests-ct.41

Ignore KOI8FTextConverter from the tests because it maps two different bytes to the same Unicode code points. We cannot go back.

16r9A -> 16rA0
16rA0 -> 16rA0

=============== Diff against MultilingualTests-ct.41 ===============

Item was changed:
  ----- Method: MultiByteFileStreamTest>>testByteTextConverter (in category 'tests') -----
  testByteTextConverter
  
  	| byteCharacters converterClasses |
  	byteCharacters := Character allByteCharacters.
  	converterClasses := ByteTextConverter allSubclasses 
+ 		copyWithoutAll: {ISO8859TextConverter . WinCPTextConverter . MacOSCPTextConverter . KOI8FTextConverter }. 
- 		copyWithoutAll: {ISO8859TextConverter . WinCPTextConverter . MacOSCPTextConverter}. 
  	converterClasses do: [ :converterClass |
  		| converter stream encoded decoded encoded2 |
  		converter := converterClass new.
  		stream := byteCharacters readStream.
  		"Find bytes that can be decoded by this converter."
  		encoded := byteCharacters select: [ :e | (converter nextFromStream: stream) notNil ].
  		"Decode those bytes."
  		stream := encoded readStream.
  		decoded := encoded collect: [ :e | converter nextFromStream: stream ].
  		self assert: stream atEnd.
  		"Re-encode the decoded bytes using #nextPutAll:toStream:, and check if they match the original bytes."
  		encoded2 := String streamContents: [ :writeStream |
  			converter nextPutAll: decoded toStream: writeStream ].
  		encoded with: encoded2 do: [ :original :reencoded |
  			self 
  				assert: original charCode = reencoded charCode
  				description: [ '{1} could not decode or re-encode {2} using #nextPutAll:toStream:. Instead, it yielded {3}.'
  					format: {
  						converterClass name.
  						original charCode.
  						reencoded charCode } ] ].
  		"Re-encode the decoded bytes using #nextPut:toStream:, and check if they match the original bytes."
  		encoded2 := String streamContents: [ :writeStream |
  			decoded do: [:e | converter nextPut: e toStream: writeStream ] ].
  		encoded with: encoded2 do: [ :original :reencoded |
  			self 
  				assert: original charCode = reencoded charCode
  				description: [ '{1} could not decode or re-encode {2} using #nextPut:toStream:. Instead, it yielded {3}.'
  					format: {
  						converterClass name.
  						original charCode.
  						reencoded charCode } ] ] ]!



More information about the Squeak-dev mailing list