Fix tests

This commit is contained in:
Michiel Borkent 2021-07-13 12:52:21 +02:00
parent 5b459da10a
commit 51b1fb58d2
2 changed files with 11 additions and 5 deletions

View file

@ -80,9 +80,13 @@ true
(let [tmp-dir (fs/create-temp-dir) (let [tmp-dir (fs/create-temp-dir)
libs-dir (fs/file tmp-dir ".gitlibs") libs-dir (fs/file tmp-dir ".gitlibs")
libs-dir2 (fs/file tmp-dir ".gitlibs2")] libs-dir2 (fs/file tmp-dir ".gitlibs2")]
(bb (pr-str `(do (babashka.deps/clojure ["-Sforce" "-Spath" "-Sdeps" "{:deps {babashka/process {:git/url \"https://github.com/babashka/process\" :sha \"4c6699d06b49773d3e5c5b4c11d3334fb78cc996\"}}}"] ;; TODO: fix for Windows native.
{:out :string :env {"PATH" (System/getenv "PATH") ;; See https://ci.appveyor.com/project/borkdude/babashka/builds/39970756
"GITLIBS" ~(str libs-dir)}}) nil))) (when-not (and test-utils/windows?
test-utils/native?)
(bb (pr-str `(do (babashka.deps/clojure ["-Sforce" "-Spath" "-Sdeps" "{:deps {babashka/process {:git/url \"https://github.com/babashka/process\" :sha \"4c6699d06b49773d3e5c5b4c11d3334fb78cc996\"}}}"]
{:out :string :env {"PATH" (System/getenv "PATH")
"GITLIBS" ~(str libs-dir)}}) nil))))
(bb (pr-str `(do (babashka.deps/clojure ["-Sforce" "-Spath" "-Sdeps" "{:deps {babashka/process {:git/url \"https://github.com/babashka/process\" :sha \"4c6699d06b49773d3e5c5b4c11d3334fb78cc996\"}}}"] {:out :string :extra-env {"GITLIBS" ~(str libs-dir2)}}) nil))) (bb (pr-str `(do (babashka.deps/clojure ["-Sforce" "-Spath" "-Sdeps" "{:deps {babashka/process {:git/url \"https://github.com/babashka/process\" :sha \"4c6699d06b49773d3e5c5b4c11d3334fb78cc996\"}}}"] {:out :string :extra-env {"GITLIBS" ~(str libs-dir2)}}) nil)))
(is (fs/exists? libs-dir)) (is (fs/exists? libs-dir))
(is (fs/exists? libs-dir2))))) (is (fs/exists? libs-dir2)))))

View file

@ -14,15 +14,17 @@
(set! *warn-on-reflection* true) (set! *warn-on-reflection* true)
(def windows? main/windows?)
(def normalize (def normalize
(if main/windows? (if windows?
(fn [s] (if (string? s) (fn [s] (if (string? s)
(str/replace s "\r\n" "\n") (str/replace s "\r\n" "\n")
s)) s))
identity)) identity))
(def escape-file-paths (def escape-file-paths
(if main/windows? (if windows?
(fn [s] (if (string? s) (fn [s] (if (string? s)
(str/replace s "\\" "\\\\") (str/replace s "\\" "\\\\")
s)) s))