mirror of
https://github.com/janet-lang/janet
synced 2024-12-27 00:40:26 +00:00
Add some test cases for module/expand-path
This commit is contained in:
parent
1ceaceada4
commit
ff3bb66272
@ -148,4 +148,14 @@
|
|||||||
(marshpeg ~(cmt "abcdf" ,identity))
|
(marshpeg ~(cmt "abcdf" ,identity))
|
||||||
(marshpeg '(group "abc"))
|
(marshpeg '(group "abc"))
|
||||||
|
|
||||||
|
# Module path expansion
|
||||||
|
(setdyn :current-file "some-dir/some-file")
|
||||||
|
(defn test-expand [path temp]
|
||||||
|
(string (module/expand-path path temp)))
|
||||||
|
|
||||||
|
(assert (= (test-expand "abc" ":cur:/:all:") "some-dir/abc") "module/expand-path 1")
|
||||||
|
(assert (= (test-expand "./abc" ":cur:/:all:") "some-dir/abc") "module/expand-path 2")
|
||||||
|
(assert (= (test-expand "abc/def.txt" ":cur:/:name:") "some-dir/def.txt") "module/expand-path 3")
|
||||||
|
(assert (= (test-expand "abc/def.txt" ":cur:/:dir:/sub/:name:") "some-dir/abc/sub/def.txt") "module/expand-path 4")
|
||||||
|
|
||||||
(end-suite)
|
(end-suite)
|
||||||
|
Loading…
Reference in New Issue
Block a user