summaryrefslogtreecommitdiffstats
path: root/tests/018
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-07-25 18:17:55 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-07-25 18:17:55 -0700
commit0f5fbbe6f79823161ca3d921255dd0f234868e02 (patch)
treeab3819b77aa6e7b1d7d5a4b434c34cc8e8530ddc /tests/018
parentd3484b08d309198ce1ed4181a81fa04057ecedbb (diff)
downloadtxr-0f5fbbe6f79823161ca3d921255dd0f234868e02.tar.gz
txr-0f5fbbe6f79823161ca3d921255dd0f234868e02.tar.bz2
txr-0f5fbbe6f79823161ca3d921255dd0f234868e02.zip
rel-path: treat empty paths as relative.
* stdlib/path-test.tl (path-volume): Don't return :abs for a path whose empty first component isn't followed by any more items. Otherwise we return :abs for a path formed by splitting the empty string, and then calls like (rel-path "" "a") complain about a mixture of absolute and relative. With this change, empty paths given to rel-path behave as if they were ".". * tests/018/rel-path.tl: New test cases.
Diffstat (limited to 'tests/018')
-rw-r--r--tests/018/rel-path.tl5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/018/rel-path.tl b/tests/018/rel-path.tl
index cdcc7e4f..11651c17 100644
--- a/tests/018/rel-path.tl
+++ b/tests/018/rel-path.tl
@@ -19,4 +19,7 @@
(rel-path "x///" "x") "."
(rel-path "x" "x///") "."
(rel-path "///x" "/x") "."
- (rel-path "../../x" "y") :error)
+ (rel-path "../../x" "y") :error
+ (rel-path "" "") "."
+ (rel-path "a" "") ".."
+ (rel-path "" "a") "a")