aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2019-06-19 12:48:07 -0400
committerCalvin Rose <calsrose@gmail.com>2019-06-19 12:48:29 -0400
commitff3bb662729f1ccfc35630ba9f77c6f39dcad07f (patch)
tree2707880f6618bd1a0c479a23898aa06db5247398
parentFix doc generation. (diff)
Add some test cases for module/expand-path
-rw-r--r--test/suite6.janet10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/suite6.janet b/test/suite6.janet
index 04819ee2..c3f7c502 100644
--- a/test/suite6.janet
+++ b/test/suite6.janet
@@ -148,4 +148,14 @@
(marshpeg ~(cmt "abcdf" ,identity))
(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)