From 14d1dc874938e73b0846e813620bbbbba1a47130 Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Sat, 25 May 2024 16:00:43 -0500 Subject: [PATCH] Pathing is not quite working... --- test/suite-bundle.janet | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/suite-bundle.janet b/test/suite-bundle.janet index c5f202c0..1866974a 100644 --- a/test/suite-bundle.janet +++ b/test/suite-bundle.janet @@ -24,20 +24,23 @@ (assert true) # smoke test # Copy since not exposed in boot.janet +(def- sep (if (= :windows (os/which)) "\\" "/")) (defn- rmrf "rm -rf in janet" [x] (case (os/stat x :mode) :file (os/rm x) :directory (do - (each y (os/dir x) (rmrf (string x "/" y))) + (each y (os/dir x) (rmrf (string x sep y))) (os/rmdir x))) nil) # Setup a temporary syspath for manipultation -(def syspath (string "./" (string (math/random)) "_jpm_tree.tmp")) +(math/seedrandom (os/cryptorand 16)) +(def syspath (string "." sep (string (math/random)) "_jpm_tree.tmp")) (rmrf syspath) -(os/mkdir syspath) +(assert (os/mkdir syspath)) +(print (os/ (put root-env *syspath* (os/realpath syspath)) (setdyn *out* @"") (assert (empty? (bundle/list)) "initial bundle/list")