]> gitweb.factorcode.org Git - factor.git/blob - core/io/encodings/utf16n/utf16n-tests.factor
96c4c29265b50ac31ea84a4cfcb7a29f6d356ba1
[factor.git] / core / io / encodings / utf16n / utf16n-tests.factor
1 USING: accessors alien.c-types alien.data kernel
2 io.encodings.utf16 io.streams.byte-array tools.test ;
3 IN: io.encodings.utf16n
4
5 : correct-endian ( obj -- ? )
6     code>> little-endian? [ utf16le = ] [ utf16be = ] if ;
7
8 [ t ] [ B{ } utf16n <byte-reader> correct-endian ] unit-test
9 [ t ] [ utf16n <byte-writer> correct-endian ] unit-test