]> gitweb.factorcode.org Git - factor.git/commitdiff
io.files: Make sure ascii can't write higher than char 127 to file. Allow writes...
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 7 Apr 2016 19:51:30 +0000 (12:51 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 7 Apr 2016 19:51:30 +0000 (12:51 -0700)
core/io/files/files-tests.factor

index ee8040f4e127c9cf216a6c2bc710194126181efc..63971ec2ce3cf3721222bdf0e16c2eb996fa15ea 100644 (file)
@@ -4,7 +4,7 @@ io.directories io.encodings.8-bit.latin1 io.encodings.ascii
 io.encodings.binary io.encodings.string io.encodings.utf16
 io.encodings.utf8 io.files io.files.private io.pathnames kernel
 locals make math sequences specialized-arrays system threads
-tools.test vocabs ;
+tools.test vocabs io.encodings ;
 FROM: specialized-arrays.private => specialized-array-vocab ;
 IN: io.files.tests
 
@@ -250,8 +250,13 @@ CONSTANT: pt-array-1
 ] unit-test
 
 [| path |
-    [ path ascii [ { } write ] with-file-writer ]
-    [ no-method? ] must-fail-with
+    [ path ascii [ { 129 } write ] with-file-writer ]
+    [ encode-error? ] must-fail-with
+] with-test-file
+
+[| path |
+    { }
+    [ path ascii [ { } write ] with-file-writer ] unit-test
 ] with-test-file
 
 [| path |