Carp/test/args.carp
2020-10-10 20:01:18 +02:00

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"))