Mantis - Squeak 5.2
Viewing Issue Advanced Details
2387 any major always 12-20-05 02:51 12-20-05 02:51
tak  
 
normal  
new  
open  
none    
none  
0002387: 'abc' = 'abc' asWideString wasn't returning true after the String refactoring.
StringEqual2.cs

'abc' = 'abc' asWideString wasn't returning true after the String refactoring. Supposedly, primitiveCompareString should fail when the argument or receiver isn't a byte object, but currently the primitive just traverses the internal of the word object. The right fix would be to fix the primitive, but so far the Squeak side code should cope with it.

self assert: 'abc' = 'abc' asWideString.
self assert: 'abc' asWideString = 'abc'.
self assert: ((ByteArray with: 97 with: 0 with: 0 with: 0) asString ~= 'a000' asWideString).
self assert: ('a000' asWideString ~= (ByteArray with: 97 with: 0 with: 0 with: 0) asString).

self assert: ('abc' sameAs: 'aBc' asWideString).
self assert: ('aBc' asWideString sameAs: 'abc').
self assert: ((ByteArray with: 97 with: 0 with: 0 with: 0) asString sameAs: 'Abcd' asWideString) not.
self assert: ('a000' asWideString sameAs: (ByteArray with: 97 with: 0 with: 0 with: 0) asString) not.
This patch is originally posted by Yoshiki http://www.kukakuka.jp/squeak/bugs/view.php?id=56. [^]
 StringEqual2.cs [^] (3,897 bytes) 12-20-05 02:51

There are no notes attached to this issue.