serialize, io.streams.byte-array: fix unit tests for utf8 encoding strictness

db4
Slava Pestov 2010-08-25 17:51:44 -07:00
parent 06f4934571
commit 261e55a918
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ CONSTANT: objects
{ 1 2 "three" } { 1 2 "three" }
V{ 1 2 "three" } V{ 1 2 "three" }
SBUF" hello world" SBUF" hello world"
"hello \u123456 unicode" "hello \u012345 unicode"
\ dup \ dup
[ \ dup dup ] [ \ dup dup ]
T{ serialize-test f "a" 2 } T{ serialize-test f "a" 2 }

View File

@ -11,7 +11,7 @@ IN: io.streams.byte-array.tests
[ B{ BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 BIN: 11101111 BIN: 10000000 BIN: 10111111 BIN: 11011111 BIN: 10000000 CHAR: x } ] [ B{ BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 BIN: 11101111 BIN: 10000000 BIN: 10111111 BIN: 11011111 BIN: 10000000 CHAR: x } ]
[ { BIN: 101111111000000111111 BIN: 1111000000111111 BIN: 11111000000 CHAR: x } >string utf8 [ write ] with-byte-writer ] unit-test [ { BIN: 101111111000000111111 BIN: 1111000000111111 BIN: 11111000000 CHAR: x } >string utf8 [ write ] with-byte-writer ] unit-test
[ { BIN: 101111111000000111111 } t ] [ { BIN: 11110101 BIN: 10111111 BIN: 10000000 BIN: 10111111 } utf8 <byte-reader> stream-contents dup >array swap string? ] unit-test [ { BIN: 1111111000000111111 } t ] [ { BIN: 11110001 BIN: 10111111 BIN: 10000000 BIN: 10111111 } utf8 <byte-reader> stream-contents dup >array swap string? ] unit-test
[ B{ 121 120 } 0 ] [ [ B{ 121 120 } 0 ] [
B{ 0 121 120 0 0 0 0 0 0 } binary B{ 0 121 120 0 0 0 0 0 0 } binary