1 USING: alien.strings tools.test kernel libc
2 io.encodings.8-bit io.encodings.utf8 io.encodings.utf16
3 io.encodings.utf16n io.encodings.ascii alien io.encodings.string ;
4 IN: alien.strings.tests
7 [ "\u0000ff" latin1 string>alien latin1 alien>string ]
11 [ "hello world" latin1 string>alien latin1 alien>string ]
14 [ "hello\u00abcdworld" ]
15 [ "hello\u00abcdworld" utf16le string>alien utf16le alien>string ]
18 [ t ] [ f expired? ] unit-test
21 "hello world" ascii malloc-string
22 dup ascii alien>string swap free
26 "hello world" utf16n malloc-string
27 dup utf16n alien>string swap free
30 [ f ] [ f utf8 alien>string ] unit-test
32 [ "hello" ] [ "hello" utf16 encode utf16 decode ] unit-test
34 [ "hello" ] [ "hello" utf16 string>alien utf16 alien>string ] unit-test