summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-06-29 06:52:38 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-06-29 06:52:38 -0700
commit7a9786b4154f939e60bb2923b8b90a81f38e20ad (patch)
treebed321bd031292edcb41fd809d303e50e5e79d7e /tests
parent71d939c17417180c2d6c77032fece5bdef7181d1 (diff)
downloadtxr-7a9786b4154f939e60bb2923b8b90a81f38e20ad.tar.gz
txr-7a9786b4154f939e60bb2923b8b90a81f38e20ad.tar.bz2
txr-7a9786b4154f939e60bb2923b8b90a81f38e20ad.zip
New function: path-search.
* lisplib.c (path_test_set_entries): Autoload on path-search. * stdlib/path-test.tl (path-search): New function. * tests/018/path-test.tl: New file. * txr.1: Documented. * stdlib/doc-lookup.tl: Updated.
Diffstat (limited to 'tests')
-rw-r--r--tests/018/path-test.tl15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/018/path-test.tl b/tests/018/path-test.tl
new file mode 100644
index 00000000..2b4e1717
--- /dev/null
+++ b/tests/018/path-test.tl
@@ -0,0 +1,15 @@
+(load "../common")
+
+(mtest
+ (path-search "sh") "/bin/sh"
+ (path-search "AlMoStCeRtAiNlLyNoNeXisTenT") nil
+ (path-search "") nil
+ (path-search "sh" nil) nil
+ (path-search "sh" '("AlMoStCeRtAiNlLyNoNeXisTenT")) nil
+ (path-search "sh" '("AlMoStCeRtAiNlLyNoNeXisTenT" "/bin")) "/bin/sh"
+ (path-search "sh" '("/bin")) "/bin/sh"
+ (path-search "sh" "AlMoStCeRtAiNlLyNoNeXisTenT") nil
+ (path-search "sh" "AlMoStCeRtAiNlLyNoNeXisTenT:/bin") "/bin/sh"
+ (path-search "sh" "/bin") "/bin/sh"
+ (path-search "sh" "/bin/") "/bin/sh"
+ (path-search "sh" ":/bin/") "/bin/sh")