summaryrefslogtreecommitdiffstats
path: root/tests/018
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-07-15 06:56:28 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-07-15 06:56:28 -0700
commit6627e21d09ac492c51059c268a3eb4341e0658ea (patch)
tree43323e5b96f2dc0c9d4ac23166f581c8c051608f /tests/018
parent3b3f6343ca72bcce408914f94e208cdf8b52cc06 (diff)
downloadtxr-6627e21d09ac492c51059c268a3eb4341e0658ea.tar.gz
txr-6627e21d09ac492c51059c268a3eb4341e0658ea.tar.bz2
txr-6627e21d09ac492c51059c268a3eb4341e0658ea.zip
paths: new tests.
* tests/018/path.tl: test coverage for abs-path-p and portable-abs-path-p.
Diffstat (limited to 'tests/018')
-rw-r--r--tests/018/path.tl46
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/018/path.tl b/tests/018/path.tl
index 7761e0fe..6a5c69ee 100644
--- a/tests/018/path.tl
+++ b/tests/018/path.tl
@@ -211,3 +211,49 @@
(path-cat "abc/" "/def/" "g") "abc/def/g"
(path-cat "abc/" "/def/" "g/") "abc/def/g/"
(path-cat "" "abc/" "/def/" "g/") "abc/def/g/")
+
+(mtest
+ (abs-path-p "") nil
+ (abs-path-p "/") t
+ (abs-path-p "/abc") t
+ (abs-path-p "abc") nil
+ (abs-path-p ".") nil)
+
+(if (eql [path-sep-chars 0] #\\)
+ (mtest
+ (abs-path-p "\\abc") t
+ (abs-path-p "a:\\abc") t
+ (abs-path-p "0:\\abc") t
+ (abs-path-p "AB0:\\abc") t
+ (abs-path-p "cd5:\\abc") t
+ (abs-path-p "a:/abc") t
+ (abs-path-p "0:/abc") t
+ (abs-path-p "AB0:/abc") t
+ (abs-path-p "cd5:/abc") t)
+ (mtest
+ (abs-path-p "\\abs") nil
+ (abs-path-p "a:\\abc") nil
+ (abs-path-p "0:\\abc") nil
+ (abs-path-p "AB0:\\abc") nil
+ (abs-path-p "cd5:\\abc") nil
+ (abs-path-p "a:/abc") nil
+ (abs-path-p "0:/abc") nil
+ (abs-path-p "AB0:/abc") nil
+ (abs-path-p "cd5:/abc") nil))
+
+(mtest
+ (portable-abs-path-p "") nil
+ (portable-abs-path-p "/") t
+ (portable-abs-path-p "/abc") t
+ (portable-abs-path-p "\\abc") t
+ (portable-abs-path-p "abc") nil
+ (portable-abs-path-p ".") nil
+ (portable-abs-path-p "\\abc") t
+ (portable-abs-path-p "a:\\abc") t
+ (portable-abs-path-p "0:\\abc") t
+ (portable-abs-path-p "AB0:\\abc") t
+ (portable-abs-path-p "cd5:\\abc") t
+ (portable-abs-path-p "a:/abc") t
+ (portable-abs-path-p "0:/abc") t
+ (portable-abs-path-p "AB0:/abc") t
+ (portable-abs-path-p "cd5:/abc") t)