From 41201fd1d19a4d32805a91829e1cfd6f8ef8e9c2 Mon Sep 17 00:00:00 2001
From: Doug Coleman <doug.coleman@gmail.com>
Date: Tue, 29 Mar 2016 08:44:24 -0700
Subject: [PATCH] tools.deploy: Make sure to deploy-test in a temp directory
 and not the factor/ directory.

---
 basis/tools/deploy/deploy-tests.factor | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/basis/tools/deploy/deploy-tests.factor b/basis/tools/deploy/deploy-tests.factor
index 4528bce6a6..251e7486e3 100644
--- a/basis/tools/deploy/deploy-tests.factor
+++ b/basis/tools/deploy/deploy-tests.factor
@@ -18,12 +18,17 @@ delete-staging-images
 
 { } [ "hello-world" shake-and-bake 550000 small-enough? ] unit-test
 
+! XXX: deploy-path is "resource:" by default, but deploying there in a
+! test would pollute the Factor directory, so deploy test to temp.
 { { "Hello world" } } [
-    f open-directory-after-deploy? [
+    H{
+        { open-directory-after-deploy? f }
+        { deploy-directory $[ temp-directory ] }
+    } [
         "hello-world" deploy
         "hello-world" deploy-path 1array
         ascii [ lines ] with-process-reader
-    ] with-variable
+    ] with-variables
 ] unit-test
 
 { } [ "sudoku" shake-and-bake 800000 small-enough? ] unit-test