aboutsummaryrefslogtreecommitdiffstats
path: root/basename-test/test
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-05-08 01:18:11 +0200
committerMattias Andrée <maandree@kth.se>2018-05-08 01:18:11 +0200
commit9803241aa8fe107d908bdfc3e225791e3fa41676 (patch)
tree6eb608727e980d5a3bafeba2b0f27b737e64f9a5 /basename-test/test
parentFix error (diff)
downloadbase-util-tests-9803241aa8fe107d908bdfc3e225791e3fa41676.tar.gz
base-util-tests-9803241aa8fe107d908bdfc3e225791e3fa41676.tar.bz2
base-util-tests-9803241aa8fe107d908bdfc3e225791e3fa41676.tar.xz
Update basename according to clarfication in 2018 edition POSIX
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'basename-test/test')
-rwxr-xr-xbasename-test/test14
1 files changed, 10 insertions, 4 deletions
diff --git a/basename-test/test b/basename-test/test
index 3e0d210..66c5b0a 100755
--- a/basename-test/test
+++ b/basename-test/test
@@ -2,7 +2,7 @@
cd -- "$(dirname "$0")"
if test -z "$BASENAME"; then
- BASENAME=../basename
+ BASENAME=../../basename
fi
b="$PREFIX $BASENAME"
@@ -21,7 +21,13 @@ ddash ()
{
test "$($b -- x)" = "x"
report $? "ddash"
- # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02
+ # http://pubs.opengroup.org/onlinepubs/9699919799/utilities/basename.html
+}
+
+ddash_suf ()
+{
+ test "$($b -- x.a a)" = "x."
+ report $? "ddash_suf"
}
lf ()
@@ -104,8 +110,8 @@ step_6_longer ()
if test $# = 0; then
- set ddash lf step_1 step_2 step_3 step_4 step_5 step_4_5 step_6 step_6_4 \
- step_6_full step_6_mismatch step_6_longer
+ set ddash ddash_suf lf step_1 step_2 step_3 step_4 step_5 step_4_5 step_6 \
+ step_6_4 step_6_full step_6_mismatch step_6_longer
fi
(
for f in $@; do