]> gitweb.factorcode.org Git - factor.git/commitdiff
lists.lazy.tests: plugs file descriptor leak
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 24 Sep 2014 20:14:46 +0000 (22:14 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Fri, 3 Oct 2014 14:12:28 +0000 (07:12 -0700)
basis/lists/lazy/lazy-tests.factor

index 55d29ddb94de9046979b36ab016a62b8c952e3ab..924c6f3fbe7fca747f47d83fe51ca059c6d8e649 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2006 Matthew Willis and Chris Double.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: io io.encodings.utf8 io.files kernel lists lists.lazy
-math sequences tools.test ;
+USING: destructors io io.encodings.utf8 io.files kernel lists
+lists.lazy math sequences tools.test ;
 IN: lists.lazy.tests
 
 [ { 1 2 3 4 } ] [
@@ -16,15 +16,15 @@ IN: lists.lazy.tests
   { 1 2 3 } >list { 4 5 } >list lcartesian-product list>array
 ] unit-test
 
-[ { 5 6 6 7 7 8 } ] [ 
+[ { 5 6 6 7 7 8 } ] [
   { 1 2 3 } >list { 4 5 } >list 2list [ first2 + ] lcomp list>array
 ] unit-test
 
-[ { 5 6 7 8 } ] [ 
+[ { 5 6 7 8 } ] [
   { 1 2 3 } >list { 4 5 } >list 2list { [ first odd? ] } [ first2 + ] lcomp* list>array
 ] unit-test
 
-[ { 4 5 6 } ] [ 
+[ { 4 5 6 } ] [
     3 { 1 2 3 } >list [ + ] with lazy-map list>array
 ] unit-test
 
@@ -41,5 +41,13 @@ IN: lists.lazy.tests
 
 [ { 1 2 3 } ] [ { 1 2 3 4 5 } >list [ 2 > ] luntil list>array ] unit-test
 
-[ ] [ "resource:license.txt" utf8 <file-reader> llines list>array drop ] unit-test
-[ ] [ "resource:license.txt" utf8 <file-reader> lcontents list>array drop ] unit-test
+[ ] [
+    "resource:license.txt" utf8 <file-reader> [
+        llines list>array drop
+    ] with-disposal
+] unit-test
+[ ] [
+    "resource:license.txt" utf8 <file-reader> [
+        lcontents list>array drop
+    ] with-disposal
+] unit-test