]> gitweb.factorcode.org Git - factor.git/blob - basis/io/encodings/8-bit/8-bit-tests.factor
factor: rename [ ] [ ] unit-test -> { } [ ] unit-test using a refactoring tool!
[factor.git] / basis / io / encodings / 8-bit / 8-bit-tests.factor
1 USING: io.encodings.string io.encodings.8-bit
2 io.encodings.8-bit.private tools.test strings arrays
3 io.encodings.8-bit.latin1 io.encodings.8-bit.windows-1252 ;
4 IN: io.encodings.8-bit.tests
5
6 { B{ CHAR: f CHAR: o CHAR: o } } [ "foo" latin1 encode ] unit-test
7 [ { 256 } >string latin1 encode ] must-fail
8 { B{ 255 } } [ { 255 } >string latin1 encode ] unit-test
9
10 { "bar" } [ "bar" latin1 decode ] unit-test
11 { { CHAR: b 233 CHAR: r } } [ B{ CHAR: b 233 CHAR: r } latin1 decode >array ] unit-test
12 { { 0xfffd 0x20AC } } [ B{ 0x81 0x80 } windows-1252 decode >array ] unit-test
13
14 { t } [ \ latin1 8-bit-encoding? ] unit-test
15 { "bar" } [ "bar" \ latin1 decode ] unit-test