Skip to content

Commit 8b9c197

Browse files
committed
Fix windows test
1 parent 8324368 commit 8b9c197

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

test/eca/features/context_test.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
[eca.llm-api :as llm-api]
1010
[eca.shared :refer [multi-str]]
1111
[eca.test-helper :as h]
12-
[matcher-combinators.test :refer [match?]]
13-
[matcher-combinators.matchers :as m]))
12+
[matcher-combinators.matchers :as m]
13+
[matcher-combinators.test :refer [match?]]))
1414

1515
(h/reset-components-before-test)
1616

test/eca/test_helper.clj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,23 @@
1010

1111
(def windows? (string/starts-with? (System/getProperty "os.name") "Windows"))
1212

13+
(def windows-drive-letter
14+
(when windows?
15+
(second (re-find #"^([A-Za-z]).+" (System/getProperty "user.dir")))))
16+
17+
18+
1319
(defn file-path [path]
1420
(cond-> path windows?
15-
(-> (string/replace-first #"^/" "C:\\\\")
21+
(-> (string/replace-first #"^/" (str windows-drive-letter ":\\\\"))
1622
(->> (re-matches #"(.+?)(\.jar:.*)?"))
1723
(update 1 string/replace "/" "\\")
1824
rest
1925
(->> (apply str)))))
2026

2127
(defn file-uri [uri]
2228
(cond-> uri windows?
23-
(string/replace #"^(file):///(?!\w:/)" "$1:///C:/")))
29+
(string/replace #"^(file):///(?!\w:/)" (str "$1:///" windows-drive-letter ":/"))))
2430

2531
(defrecord TestMessenger [messages* diagnostics*]
2632
messenger/IMessenger

0 commit comments

Comments
 (0)