]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/io/mmap/mmap-tests.factor
factor: Clean up wrong form of specialized-arrays in using lists.
[factor.git] / basis / io / mmap / mmap-tests.factor
index ef92d0271b3ef3c6aa1e8f825c0bf110614c2c86..3758dcefa65b523b28188c794632bea648e9df7b 100644 (file)
@@ -1,26 +1,22 @@
 USING: alien.c-types alien.data compiler.tree.debugger
-io.encodings.ascii io.files io.files.temp io.files.unique
-io.mmap kernel locals math sequences sequences.private
-specialized-arrays tools.test ;
-IN: io.mmap.tests
+io.encodings.ascii io.files io.mmap kernel locals math sequences
+sequences.private specialized-arrays tools.test ;
 
 SPECIALIZED-ARRAY: uint
 
-[
-    "mmap-test-file" ".txt" [| path |
-        "12345" path ascii set-file-contents
-        { } [ path [ char <mapped-array> CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
-        { 5 } [ path [ char <mapped-array> length ] with-mapped-file ] unit-test
-        { 5 } [ path [ char <mapped-array> length ] with-mapped-file-reader ] unit-test
-        { "22345" } [ path ascii file-contents ] unit-test
-        { t } [ path uint [ sum ] with-mapped-array integer? ] unit-test
-        { t } [ path uint [ sum ] with-mapped-array-reader integer? ] unit-test
-    ] cleanup-unique-file
+[| path |
+    "12345" path ascii set-file-contents
+    { } [ path [ char <mapped-array> CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
+    { 5 } [ path [ char <mapped-array> length ] with-mapped-file ] unit-test
+    { 5 } [ path [ char <mapped-array> length ] with-mapped-file-reader ] unit-test
+    { "22345" } [ path ascii file-contents ] unit-test
+    { t } [ path uint [ sum ] with-mapped-array integer? ] unit-test
+    { t } [ path uint [ sum ] with-mapped-array-reader integer? ] unit-test
+] with-test-file
 
-    "mmap-empty-file" ".txt" [| path |
-        [ path [ drop ] with-mapped-file ] [ bad-mmap-size? ] must-fail-with
-    ] cleanup-unique-file
-] with-temp-directory
+[| path |
+    [ path [ drop ] with-mapped-file ] [ bad-mmap-size? ] must-fail-with
+] with-test-file
 
 { t } [
     [ "test.txt" <mapped-file> void* <c-direct-array> first-unsafe ]