Add some commented out unit tests to io.ports.tests that seem like they should be supported

db4
Doug Coleman 2010-02-24 03:32:02 -06:00
parent b55cddf969
commit ebd2cce1be
1 changed files with 41 additions and 1 deletions

View File

@ -1,6 +1,7 @@
USING: destructors io io.encodings.binary io.files io.directories
io.files.temp io.ports kernel sequences math
specialized-arrays.instances.alien.c-types.int tools.test ;
specialized-arrays.instances.alien.c-types.int tools.test
specialized-arrays alien.c-types classes.struct alien ;
IN: io.ports.tests
! Make sure that writing malloced storage to a file works, and
@ -20,4 +21,43 @@ IN: io.ports.tests
] with-file-reader
] unit-test
USE: multiline
/*
[ ] [
BV{ 0 1 2 } "test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
B{ 0 1 2 } =
] unit-test
STRUCT: pt { x uint } { y uint } ;
SPECIALIZED-ARRAY: pt
CONSTANT: pt-array-1
pt-array{ S{ pt f 1 1 } S{ pt f 2 2 } S{ pt f 3 3 } }
[ ] [
pt-array-1
"test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
pt-array-1 >c-ptr sequence=
] unit-test
[ ] [
pt-array-1 rest-slice
"test.txt" temp-file binary set-file-contents
] unit-test
[ t ] [
"test.txt" temp-file binary file-contents
pt-array-1 rest-slice >c-ptr sequence=
] unit-test
*/
[ ] [ "test.txt" temp-file delete-file ] unit-test