better io.mmap test

db4
Doug Coleman 2009-02-26 19:58:25 -06:00
parent d875033986
commit 1bd35e6f62
1 changed files with 4 additions and 14 deletions

View File

@ -11,21 +11,11 @@ IN: io.mmap.tests
[ "mmap-test-file.txt" temp-file delete-file ] ignore-errors
[ ]
[ "mmap-empty-file.txt" temp-file touch-file ] unit-test
[ "mmap-empty-file.txt" temp-file delete-file ] ignore-errors
[ ] [ "mmap-empty-file.txt" temp-file touch-file ] unit-test
! Test for leaking resources bug on Unix
[ ]
[
100000 [
[
"mmap-empty-file.txt" temp-file [
drop
] with-mapped-file
] [ dup bad-mmap-size? [ drop ] [ rethrow ] if ] recover
] times
"asdf" "mmap-asdf-file.txt" temp-file [ ascii set-file-contents ] keep [
"mmap-empty-file.txt" temp-file [
drop
] with-mapped-file
] unit-test
] [ bad-mmap-size? ] must-fail-with