diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-06-26 11:28:11 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-06-26 11:28:11 -0700 |
commit | bf2e5199e8dbc4e6fd4fcac5dab1ea16f4ec5970 (patch) | |
tree | e1093bb6dec46c95ff2545b1d0bf6a17357887d9 /tests/018 | |
parent | ef8a410aff1e90f727f813814412dfe625350aa0 (diff) | |
download | txr-bf2e5199e8dbc4e6fd4fcac5dab1ea16f4ec5970.tar.gz txr-bf2e5199e8dbc4e6fd4fcac5dab1ea16f4ec5970.tar.bz2 txr-bf2e5199e8dbc4e6fd4fcac5dab1ea16f4ec5970.zip |
suffix functions: requirements change.
The short-suffix and long-suffix functions will now return the
suffix including the leading period. This was a suggestion
from user Paul A. Patience, which is a good requirement.
Since these functions were newly introduced just the last
release, I'm not going to provide backwards compatibility
switching for them.
* stream.c (short_suffix, long_suffix): Duplicate the suffix
starting at the dot, not dot + 1.
* tests/018/path.tl: Test cases updated.
* txr.1: Documentation updated.
Diffstat (limited to 'tests/018')
-rw-r--r-- | tests/018/path.tl | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/018/path.tl b/tests/018/path.tl index a00b9465..bb45d000 100644 --- a/tests/018/path.tl +++ b/tests/018/path.tl @@ -8,13 +8,13 @@ (short-suffix "a") nil (short-suffix "a" 0) 0 (short-suffix ".") nil - (short-suffix "a.") "" - (short-suffix "a.b.") "" + (short-suffix "a.") "." + (short-suffix "a.b.") "." (short-suffix ".c") nil - (short-suffix "a.c") "c" - (short-suffix "a.b.c") "c" - (short-suffix "foo.txt.gz") "gz" - (short-suffix "txt.gz") "gz" + (short-suffix "a.c") ".c" + (short-suffix "a.b.c") ".c" + (short-suffix "foo.txt.gz") ".gz" + (short-suffix "txt.gz") ".gz" (short-suffix ".gz") nil) (mtest @@ -25,16 +25,16 @@ (long-suffix "a") nil (long-suffix "a" 0) 0 (long-suffix ".") nil - (long-suffix "a.") "" - (long-suffix "a.b.") "b." + (long-suffix "a.") "." + (long-suffix "a.b.") ".b." (long-suffix ".c") nil - (long-suffix "a.c") "c" - (long-suffix "a.b.c") "b.c" - (long-suffix "foo.txt.gz") "txt.gz" + (long-suffix "a.c") ".c" + (long-suffix "a.b.c") ".b.c" + (long-suffix "foo.txt.gz") ".txt.gz" (long-suffix ".gz") nil - (long-suffix ".txt.gz") "gz" - (long-suffix "/.txt.gz") "gz" - (long-suffix "a/.txt.gz") "gz") + (long-suffix ".txt.gz") ".gz" + (long-suffix "/.txt.gz") ".gz" + (long-suffix "a/.txt.gz") ".gz") (mtest (short-suffix "/") nil @@ -43,12 +43,12 @@ (short-suffix "a/.") nil (short-suffix ".a/") nil (short-suffix ".a/b") nil - (short-suffix ".a/c.b") "b" + (short-suffix ".a/c.b") ".b" (short-suffix ".a/b/") nil (short-suffix ".a/b/.b") nil (short-suffix ".a/b/.b/") nil - (short-suffix ".a/b/c.b") "b" - (short-suffix ".a/b/c.b/") "b" + (short-suffix ".a/b/c.b") ".b" + (short-suffix ".a/b/c.b/") ".b" (short-suffix ".a/b/c.b//") nil) (mtest @@ -61,10 +61,10 @@ (long-suffix ".a/b/") nil (long-suffix ".a/b/.b") nil (long-suffix ".a/b/.b/") nil - (long-suffix ".a/b/c.b") "b" - (long-suffix ".a/b/c.b/") "b" - (long-suffix "a.b/c.d.e") "d.e" - (long-suffix "a.b/c.d.e/") "d.e" + (long-suffix ".a/b/c.b") ".b" + (long-suffix ".a/b/c.b/") ".b" + (long-suffix "a.b/c.d.e") ".d.e" + (long-suffix "a.b/c.d.e/") ".d.e" (long-suffix "a.b/c.d.e/f") nil - (long-suffix "a.b/c.d.e/f.g.h") "g.h" + (long-suffix "a.b/c.d.e/f.g.h") ".g.h" (long-suffix "a.b/c.d.e//") nil) |