summaryrefslogtreecommitdiffstats
path: root/tests/018
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-05-03 06:51:19 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-05-03 06:51:19 -0700
commit8be2ee867659dc8b6c47d4fb6694aceaf10bfd7c (patch)
tree728eb3bfac974743a7fa428a447195cbf0fc54d2 /tests/018
parentde3082638e204aae1fa63a390967cbef082304bb (diff)
downloadtxr-8be2ee867659dc8b6c47d4fb6694aceaf10bfd7c.tar.gz
txr-8be2ee867659dc8b6c47d4fb6694aceaf10bfd7c.tar.bz2
txr-8be2ee867659dc8b6c47d4fb6694aceaf10bfd7c.zip
New function: rel-path.
* lisplib.c (copy_file_set_entries): Add rel-path as autoload trigger for copy-file module. * share/txr/stdlib/copy-file.tl (rel-path): New function. * tests/018/rel-path.tl: New file. * txr.1: Documented. * share/txr/stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'tests/018')
-rw-r--r--tests/018/rel-path.tl17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/018/rel-path.tl b/tests/018/rel-path.tl
new file mode 100644
index 00000000..1afff796
--- /dev/null
+++ b/tests/018/rel-path.tl
@@ -0,0 +1,17 @@
+(load "../common")
+
+(mtest
+ (rel-path "/abc" "abc") :error
+ (rel-path "abc" "/abc") :error
+ (rel-path "." ".") "."
+ (rel-path "./abc" "abc") "."
+ (rel-path "abc" "./abc") "."
+ (rel-path "./abc" "./abc") "."
+ (rel-path "abc" "abc") "."
+ (rel-path "." "abc") "abc"
+ (rel-path "abc/def" "abc/ghi") "../ghi"
+ (rel-path "xyz/../abc/def" "abc/ghi") "../ghi"
+ (rel-path "abc" "d/e/f/g/h") "../d/e/f/g/h"
+ (rel-path "abc" "d/e/../g/h") "../d/g/h"
+ (rel-path "d/e/../g/h" ".") "../../.."
+ (rel-path "d/e/../g/h" "a/b") "../../../a/b")