From 4bf3e1c7c161e83e412ee54aa3bfa4b8f2bbba1b Mon Sep 17 00:00:00 2001 From: hellerve Date: Tue, 19 Jan 2021 10:55:37 +0100 Subject: [PATCH] fix for new carp --- path.carp | 8 ++++---- test/path.carp | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/path.carp b/path.carp index e6eb272..c4055b3 100644 --- a/path.carp +++ b/path.carp @@ -32,7 +32,7 @@ variable we use on this OS.") (def search-path-separator \;) (def extension-pat #"\.[^\\/\.]*$") (def sep-string "\\")) - (not-on-windows + (posix-only (defn absolute? [p] (String.starts-with? p "/")) (def separator \/) (def separators [\/]) @@ -127,9 +127,9 @@ Examples on POSIX: (doc drop-extension "drops the extension of a path `p`. Does nothing if there is none.") (defn drop-extension [p] - @(match (split-extension p) - (Maybe.Nothing) p - (Maybe.Just pair) (Pair.a &pair))) + (match (split-extension p) + (Maybe.Nothing) @p + (Maybe.Just pair) @(Pair.a &pair))) (doc add-extension "adds an extension `ext` to a path `p`.") (defn add-extension [p ext] (String.concat &[@p @"." @ext])) diff --git a/test/path.carp b/test/path.carp index 200777b..6882dad 100644 --- a/test/path.carp +++ b/test/path.carp @@ -3,7 +3,7 @@ (use-all Path Test) -(not-on-windows +(posix-only (deftest test (assert-equal test "path/joined" @@ -41,11 +41,11 @@ "cwd works" ) ; TODO why does this test not work? - ;(assert-equal test - ; "file" - ; &(drop-extension "file.txt") - ; "drop-extension works if there is an extension" - ;) + (assert-equal test + "file" + &(drop-extension "file.txt") + "drop-extension works if there is an extension" + ) (assert-equal test "file" &(drop-extension "file")