1 USING: arrays io io.files kernel math parser strings system
2 tools.test words namespaces make io.encodings.8-bit
3 io.encodings.binary sequences ;
7 "resource:core/io/test/no-trailing-eol.factor" run-file
8 "foo" "io.tests" lookup
12 "This is a line.\rThis is another line.\r"
14 "resource:core/io/test/mac-os-eol.txt" latin1 <file-reader>
15 [ 500 read ] with-input-stream
21 "resource:core/io/test/binary.txt" latin1 <file-reader>
22 [ read1 ] with-input-stream >fixnum
25 ! Make sure we use correct to_c_string form when writing
26 [ ] [ "\0" write ] unit-test
29 "It seems Jobs has lost his grasp on reality again.\n"
30 "separator-test.txt" temp-file latin1 set-file-contents
35 { "It seems " CHAR: J }
36 { "obs has lost h" CHAR: i }
37 { "s grasp on reality again.\n" f }
41 "separator-test.txt" temp-file
42 latin1 <file-reader> [
43 "J" read-until 2array ,
44 "i" read-until 2array ,
45 "X" read-until 2array ,
52 10 [ 65536 read drop ] times