mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
18 lines
550 B
Plaintext
18 lines
550 B
Plaintext
(load "Test.carp")
|
|
(use Test)
|
|
|
|
(defndynamic _make-exe-path [pth]
|
|
(let [out (Project.get-config "output-directory")
|
|
sep (if (or (= (host-os) "windows") (= (host-os) "mingw32")) "\\" "/")
|
|
lst (Dynamic.String.suffix out (- (String.length out) 1))]
|
|
(Dynamic.String.concat (array out (if (= lst sep) "" sep) pth))))
|
|
|
|
(defmacro make-exe-path [pth]
|
|
(_make-exe-path pth))
|
|
|
|
(deftest test
|
|
(assert-equal test
|
|
$[@(make-exe-path "Untitled")]
|
|
&System.args
|
|
"System.args works as expected"))
|