From 37cd54cfbbd55f26c9370df8f34b5ffbba9ee95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Lindqvist?= Date: Sun, 11 Oct 2015 04:21:43 +0200 Subject: [PATCH] io.files.windows.tests: windows test for the save-image not failing failure #1489 this one really should always throw permission denied or else something is very spooky --- basis/io/files/windows/windows-tests.factor | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/basis/io/files/windows/windows-tests.factor b/basis/io/files/windows/windows-tests.factor index 812e397219..40e94056ca 100644 --- a/basis/io/files/windows/windows-tests.factor +++ b/basis/io/files/windows/windows-tests.factor @@ -1,7 +1,8 @@ ! Copyright (C) 2010 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: io.backend io.files io.files.windows io.pathnames kernel -sequences splitting tools.test ; +USING: combinators continuations io.backend io.directories io.files +io.files.temp io.files.windows io.pathnames kernel memory sequences +splitting tools.test windows.kernel32 ; IN: io.files.windows.tests [ f ] [ "\\foo" absolute-path? ] unit-test @@ -65,3 +66,15 @@ IN: io.files.windows.tests } [ 3 win32-file-attributes ] unit-test + +! set-file-attributes & save-image +{ { "kernel-error" 1 13 f } } [ + [ + "read-only.image" temp-file { + [ ?delete-file ] + [ touch-file ] + [ FILE_ATTRIBUTE_READONLY set-file-attributes ] + [ save-image ] + } cleave + ] [ ] recover +] unit-test