1 USING: alien.c-types alien.data compiler.tree.debugger
2 io.encodings.ascii io.files io.mmap kernel locals math sequences
3 sequences.private specialized-arrays tools.test ;
5 SPECIALIZED-ARRAY: uint
8 "12345" path ascii set-file-contents
9 { } [ path [ char <mapped-array> CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
10 { 5 } [ path [ char <mapped-array> length ] with-mapped-file ] unit-test
11 { 5 } [ path [ char <mapped-array> length ] with-mapped-file-reader ] unit-test
12 { "22345" } [ path ascii file-contents ] unit-test
13 { t } [ path uint [ sum ] with-mapped-array integer? ] unit-test
14 { t } [ path uint [ sum ] with-mapped-array-reader integer? ] unit-test
18 [ path [ drop ] with-mapped-file ] [ bad-mmap-size? ] must-fail-with
22 [ "test.txt" <mapped-file> void* <c-direct-array> first-unsafe ]
23 { nth-unsafe } inlined?