]> gitweb.factorcode.org Git - factor.git/commitdiff
xml.writer.tests: use temp-file instead of assuming resource: is writable 1127/head
authorBjörn Lindqvist <bjourne@gmail.com>
Thu, 28 Aug 2014 17:12:20 +0000 (19:12 +0200)
committerBjörn Lindqvist <bjourne@gmail.com>
Thu, 28 Aug 2014 17:12:20 +0000 (19:12 +0200)
basis/xml/writer/writer-tests.factor

index ad54926a79432635c168ad6a449f1ca94319d72a..5f4f84f74c8976f0f5a424d357cb4ea77969559e 100644 (file)
@@ -2,7 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: xml.data xml.writer tools.test fry xml xml.syntax kernel multiline
 xml.writer.private io.streams.string xml.traversal sequences
-io.encodings.utf8 io.files accessors io.directories math math.parser ;
+io.encodings.utf8 io.files io.files.temp accessors io.directories math
+math.parser ;
 IN: xml.writer.tests
 
 ! Add a test for pprint-xml with sensitive-tags
@@ -58,9 +59,12 @@ IN: xml.writer.tests
 [ "<foo>         bar            </foo>" string>xml pprint-xml>string ] unit-test
 [ "<foo'>" ] [ "<foo'>" <unescaped> xml>string ] unit-test
 
-CONSTANT: test-file "resource:basis/xml/writer/test.xml"
+: test-file ( -- path )
+    "test.xml" temp-file ;
 
-[ ] [ "<?xml version='1.0' encoding='UTF-16BE'?><x/>" string>xml test-file utf8 [ write-xml ] with-file-writer ] unit-test
+[ ] [
+    "<?xml version='1.0' encoding='UTF-16BE'?><x/>" string>xml test-file utf8 [ write-xml ] with-file-writer
+] unit-test
 [ "x" ] [ test-file file>xml body>> name>> main>> ] unit-test
 [ ] [ test-file delete-file ] unit-test