]> gitweb.factorcode.org Git - factor.git/blobdiff - core/io/encodings/utf16/utf16-tests.factor
io.encodings.utf16n: merge with io.encodings.utf16
[factor.git] / core / io / encodings / utf16 / utf16-tests.factor
index a4938e32c281a12de8ee056455da163089728768..71a16c63b21486c771288b36e229378f193bfa93 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2008 Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: kernel tools.test io.encodings.utf16 arrays sbufs
-io.streams.byte-array sequences io.encodings io strings
-io.encodings.string alien.c-types alien.strings accessors classes ;
+USING: accessors alien.data arrays io.encodings.string
+io.encodings.utf16 io.streams.byte-array kernel strings
+tools.test ;
 IN: io.encodings.utf16.tests
 
 { { CHAR: x } } [ B{ 0 CHAR: x } utf16be decode >array ] unit-test
@@ -28,3 +28,10 @@ IN: io.encodings.utf16.tests
 
 { B{ CHAR: a 0 CHAR: b 0 CHAR: c 0 } } [ "abc" utf16le encode ] unit-test
 { B{ 0 CHAR: a 0 CHAR: b 0 CHAR: c } } [ "abc" utf16be encode ] unit-test
+
+: correct-endian ( obj -- ? )
+    code>> little-endian? utf16le utf16be ? = ;
+
+{ t } [ B{ } utf16n <byte-reader> correct-endian ] unit-test
+{ t } [ utf16n <byte-writer> correct-endian ] unit-test
+