fix for new carp
This commit is contained in:
@@ -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]))
|
||||
|
@@ -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")
|
||||
|
Reference in New Issue
Block a user