Fixed allSelectorsSent because a simpler implementation was overriding the original.
[cslatevm.git] / tests / i18n.slate
blobfde8e55345ec80e4c937a7f663634305aaee8eb7
2 _@Unicode testRead: filename encoding: encoding
3 [| test times |
4   test: ExtensibleArray new.
5   (File newNamed: filename &mode: File Read)
6     sessionDo:
7       [| :file decoder |
8        decoder: (encoding Decoder newOn: file reader).
9        [decoder isAtEnd] whileFalse:
10          [test addLast: decoder next]].
11   test as: UnicodeString
14 _@Unicode testRW: sourceFileName to: targetFileName inEncoding: inenc outEncoding: outenc &littleEndian: le
16   (File newNamed: sourceFileName &mode: File Read) sessionDo:
17     [| :source |
18      (File newNamed: targetFileName &mode: File CreateWrite)
19        sessionDo:
20          [| :target |
21           (inenc Decoder newOn: source reader)
22             >> (outenc Encoder newOn: target writer &littleEndian: le)]].
25 Unicode test ::= Unicode testRead: 'tests/testuni.txt' encoding: UTF8.
26 Unicode subsetAt: ((test at: 0) as: Integer).
27 (test at: 0) isLetter.
29 Unicode encoder ::= UTF8 Encoder newOn: Console writer.
30 test reader >> encoder.
32 "The test files aren't here because I'm not sure about copyrights. You can find them at 
33 http://jshin.net/i18n/utftest/"
35 Unicode test16BE ::= Unicode testRead: 'tests/i18n/nobom.utf16be.html' encoding: UTF16BE.
36 Unicode test16LE ::= Unicode testRead: 'tests/i18n/nobom.utf16le.html' encoding: UTF16LE.
37 Unicode test16BEBOM ::= Unicode testRead: 'tests/i18n/bom.utf16be.html' encoding: UTF16.
38 Unicode test16LEBOM ::= Unicode testRead: 'tests/i18n/bom.utf16le.html' encoding: UTF16.
40 Unicode testRW: 'tests/i18n/nobom.utf16be.html' to: 'tests/i18n/test-nobom16be' inEncoding: UTF16BE outEncoding: UTF16BE.
41 Unicode testRW: 'tests/i18n/nobom.utf16le.html' to: 'tests/i18n/test-nobom16le' inEncoding: UTF16LE outEncoding: UTF16LE.
42 Unicode testRW: 'tests/i18n/bom.utf16be.html' to: 'tests/i18n/test-bom16be' inEncoding: UTF16 outEncoding: UTF16.
43 Unicode testRW: 'tests/i18n/bom.utf16le.html' to: 'tests/i18n/test-bom16le' inEncoding: UTF16 outEncoding: UTF16 &littleEndian: True.
45 "This just check that the normalization does something. Add tests whether the results are correct."
47 ('käöå' as: UnicodeString) normalizeTo: Unicode NFD.
48 ('käöå' as: UnicodeString) normalizeTo: Unicode NFKD.
49 ('käöå' as: UnicodeString) normalizeTo: Unicode NFC.
50 ('käöå' as: UnicodeString) normalizeTo: Unicode NFKC.