]> gitweb.factorcode.org Git - factor.git/blob - extra/io/encodings/8-bit/8-bit-tests.factor
Merge branch 'master' of git://factorcode.org/git/factor
[factor.git] / extra / 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 IN: io.encodings.8-bit.tests
4
5 [ B{ CHAR: f CHAR: o CHAR: o } ] [ "foo" latin1 encode ] unit-test
6 [ { 256 } >string latin1 encode ] must-fail
7 [ B{ 255 } ] [ { 255 } latin1 encode ] unit-test
8
9 [ "bar" ] [ "bar" latin1 decode ] unit-test
10 [ { CHAR: b 233 CHAR: r } ] [ { CHAR: b 233 CHAR: r } latin1 decode >array ] unit-test
11 [ { HEX: fffd HEX: 20AC } ] [ { HEX: 81 HEX: 80 } windows-1252 decode >array ] unit-test
12
13 [ t ] [ \ latin1 8-bit-encoding? ] unit-test
14 [ "bar" ] [ "bar" \ latin1 decode ] unit-test