From 2ada639a62a35f96d8e67bad6eda11e62dedf569 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Thu, 7 Apr 2016 12:51:30 -0700 Subject: [PATCH] io.files: Make sure ascii can't write higher than char 127 to file. Allow writes to ascii from { } and B{ } if they don't violate the encoding. --- core/io/files/files-tests.factor | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/io/files/files-tests.factor b/core/io/files/files-tests.factor index ee8040f4e1..63971ec2ce 100644 --- a/core/io/files/files-tests.factor +++ b/core/io/files/files-tests.factor @@ -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 |