1 USING: io io.streams.string kernel namespaces pack strings tools.test ;
3 [ B{ 1 0 2 0 0 3 0 0 0 4 0 0 0 0 0 0 0 5 } ] [
10 "cstiq" [ pack-be ] keep unpack-be
13 [ B{ 1 2 0 3 0 0 4 0 0 0 5 0 0 0 0 0 0 0 } ] [
15 { 1 2 3 4 5 } "cstiq" pack-le
21 "cstiq" [ pack-le ] keep unpack-le
24 [ { -1 -2 -3 -4 -5 } ] [
26 "cstiq" [ pack-le ] keep unpack-le
29 [ { -1 -2 -3 -4 -5 3.14 } ] [
30 { -1 -2 -3 -4 -5 3.14 }
31 "cstiqd" [ pack-be ] keep unpack-be
34 [ { -1 -2 -3 -4 -5 } ] [
36 "cstiq" [ pack-native ] keep unpack-native
40 [ 2 "int" b, ] B{ } make
41 <string-reader> [ "int" read-native ] with-input-stream
44 [ "FRAM" ] [ "FRAM\0" [ read-c-string ] with-string-reader ] unit-test
45 [ f ] [ "" [ read-c-string ] with-string-reader ] unit-test
46 [ 5 ] [ "FRAM\0\u000005\0\0\0\0\0\0\0" [ read-c-string drop read-u64 ] with-string-reader ] unit-test