diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-07-10 08:44:16 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-07-10 08:44:16 -0700 |
commit | 91d1a70c1d64c67bbaa5dc94dabf7461ad97bb8d (patch) | |
tree | 08f93715512867f64d942fcecaddece9e2d7b141 /tests/018 | |
parent | 44fc04addc852cd4d0bbfa53a44b69679aaa29c2 (diff) | |
download | txr-91d1a70c1d64c67bbaa5dc94dabf7461ad97bb8d.tar.gz txr-91d1a70c1d64c67bbaa5dc94dabf7461ad97bb8d.tar.bz2 txr-91d1a70c1d64c67bbaa5dc94dabf7461ad97bb8d.zip |
New functions: trim-short-suffix, trim-long-suffix.
* lib.c, lib.h (chk_substrdup): New function.
* stream.c, stream.h (trim_short_suffix, trim_long_suffix):
New functions.
(stream_init): trim-short-suffix and trim-long-suffix
intrinsics registered.
* tests/018/path.tl: New tests.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'tests/018')
-rw-r--r-- | tests/018/path.tl | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/018/path.tl b/tests/018/path.tl index aaaa6e11..62dbda6c 100644 --- a/tests/018/path.tl +++ b/tests/018/path.tl @@ -86,6 +86,54 @@ (long-suffix "a.b/c.///") ".") (mtest + (trim-short-suffix "") "" + (trim-short-suffix ".") "." + (trim-short-suffix "/.") "/." + (trim-short-suffix ".b") ".b" + (trim-short-suffix ".a.b") ".a" + (trim-short-suffix ".a.b.c") ".a.b" + (trim-short-suffix "/.b") "/.b" + (trim-short-suffix "/.b/") "/.b/" + (trim-short-suffix "/.b//") "/.b//" + (trim-short-suffix "a.b") "a" + (trim-short-suffix "/a.b") "/a" + (trim-short-suffix "/a.b/") "/a/" + (trim-short-suffix "/a.b//") "/a//" + (trim-short-suffix "a.") "a" + (trim-short-suffix "/a.") "/a" + (trim-short-suffix "/a./") "/a/" + (trim-short-suffix "/a.//") "/a//") + +(mtest + (trim-long-suffix "") "" + (trim-long-suffix ".") "." + (trim-long-suffix "/.") "/." + (trim-long-suffix ".b") ".b" + (trim-long-suffix ".a.b") ".a" + (trim-long-suffix ".a.b.c") ".a" + (trim-long-suffix "/.b") "/.b" + (trim-long-suffix "/.b/") "/.b/" + (trim-long-suffix "/.b//") "/.b//" + (trim-long-suffix "a.b") "a" + (trim-long-suffix "/a.b") "/a" + (trim-long-suffix "/a.b/") "/a/" + (trim-long-suffix "/a.b//") "/a//" + (trim-long-suffix "/.b.c") "/.b" + (trim-long-suffix "/.b.c/") "/.b/" + (trim-long-suffix "/.b.c//") "/.b//" + (trim-long-suffix "/.b.c.d") "/.b" + (trim-long-suffix "/.b.c.d/") "/.b/" + (trim-long-suffix "/.b.c.d//") "/.b//" + (trim-long-suffix "a.b.c") "a" + (trim-long-suffix "/a.b.c") "/a" + (trim-long-suffix "/a.b.c/") "/a/" + (trim-long-suffix "/a.b.c//") "/a//" + (trim-long-suffix "a.") "a" + (trim-long-suffix "/a.") "/a" + (trim-long-suffix "/a./") "/a/" + (trim-long-suffix "/a.//") "/a//") + +(mtest (base-name "") "" (base-name "/") "/" (base-name ".") "." |