mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
(load "core/Filepath.carp") ;; specified path to avoid loading itself on case insensitive file systems
|
|
(load "Test.carp")
|
|
|
|
(use-all Test Filepath)
|
|
|
|
(deftest test
|
|
(assert-equal test
|
|
"test.h"
|
|
&(file-from-path "/an/absolute/path/for/test.h")
|
|
"file-from-path works with non-empty paths"
|
|
)
|
|
(assert-equal test
|
|
"."
|
|
&(file-from-path ".")
|
|
"file-from-path works with relative paths"
|
|
)
|
|
(assert-equal test
|
|
""
|
|
&(file-from-path "")
|
|
"file-from-path works with empty paths"
|
|
)
|
|
(assert-equal test
|
|
"/an/absolute/path/for/"
|
|
&(dir-from-path "/an/absolute/path/for/test.h")
|
|
"dir-from-path works with non-empty paths"
|
|
)
|
|
(assert-equal test
|
|
""
|
|
&(dir-from-path ".")
|
|
"dir-from-path works with relative paths"
|
|
)
|
|
(assert-equal test
|
|
""
|
|
&(dir-from-path "")
|
|
"dir-from-path works with empty paths"
|
|
)
|
|
)
|