1 USING: io io.mmap io.files kernel tools.test continuations
2 sequences io.encodings.ascii accessors ;
5 [ "mmap-test-file.txt" temp-file delete-file ] ignore-errors
6 [ ] [ "12345" "mmap-test-file.txt" temp-file ascii set-file-contents ] unit-test
7 [ ] [ "mmap-test-file.txt" temp-file dup file-info size>> [ CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
8 [ 5 ] [ "mmap-test-file.txt" temp-file dup file-info size>> [ length ] with-mapped-file ] unit-test
9 [ "22345" ] [ "mmap-test-file.txt" temp-file ascii file-contents ] unit-test
10 [ "mmap-test-file.txt" temp-file delete-file ] ignore-errors