1 USING: accessors alien.c-types alien.data destructors io
2 io.directories io.encodings.ascii io.encodings.binary
3 io.encodings.string io.encodings.utf8 io.files io.files.temp
4 io.pipes io.sockets kernel libc math namespaces sequences
8 ! Make sure that writing malloced storage to a file works, and
9 ! also make sure that writes larger than the buffer size work
12 "test.txt" temp-file binary [
16 100,000 int malloc-array &free [ copy ] keep write
22 "test.txt" temp-file binary [
23 100,000 4 * read int cast-array 100,000 iota sequence=
27 [ ] [ "test.txt" temp-file delete-file ] unit-test
29 ! Getting the stream-element-type of an output-port was broken
30 [ +byte+ ] [ binary <pipe> [ stream-element-type ] with-disposal ] unit-test
31 [ +byte+ ] [ binary <pipe> [ out>> stream-element-type ] with-disposal ] unit-test
32 [ +character+ ] [ ascii <pipe> [ stream-element-type ] with-disposal ] unit-test
33 [ +character+ ] [ ascii <pipe> [ out>> stream-element-type ] with-disposal ] unit-test
35 ! Issue #1256 regression test
36 ! Port length would be zero before data is received
38 "google.com" 80 <inet> binary [
39 "GET /\n" utf8 encode write flush
40 input-stream get stream-contents