aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-10-24 11:31:20 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2015-12-17 15:25:24 +0200
commit790e1d4e29514da57265875496f9dcb7c2d6f1c2 (patch)
tree97817d9e02d8bba1ccddc73d1deea70e1ab28d87
parentd72f0a0008697df2533aad69e9daddaa4ace10ca (diff)
downloadgrecs-790e1d4e29514da57265875496f9dcb7c2d6f1c2.tar.gz
grecs-790e1d4e29514da57265875496f9dcb7c2d6f1c2.tar.bz2
Test pathname expansion
-rw-r--r--tests/wordsplit.at87
1 files changed, 81 insertions, 6 deletions
diff --git a/tests/wordsplit.at b/tests/wordsplit.at
index 2cc9e4a..0ed6607 100644
--- a/tests/wordsplit.at
+++ b/tests/wordsplit.at
@@ -540,7 +540,7 @@ TESTWSP([getvar, alternate value],[wsp-var wsp-var23 wsp-alt wsp-alt02 wsp-getva
dnl Something that doesn't fit into TESTWSP
-AT_SETUP([simple command expansion])
+AT_SETUP([simple command substitution])
AT_KEYWORDS([wordsplit wsp wsp-cmd wsp-cmd-1 wsp50])
AT_CHECK([
mkdir dir
@@ -559,7 +559,7 @@ EOT
])
AT_CLEANUP
-AT_SETUP([quoted command expansion])
+AT_SETUP([quoted command substitution])
AT_KEYWORDS([wordsplit wsp wsp-cmd wsp-cmd-2 wsp51])
AT_CHECK([
mkdir dir
@@ -577,7 +577,7 @@ EOT
])
AT_CLEANUP
-AT_SETUP([coalesced command expansion])
+AT_SETUP([coalesced command substitution])
AT_KEYWORDS([wordsplit wsp wsp-cmd wsp-cmd-3 wsp52])
AT_CHECK([
mkdir dir
@@ -594,7 +594,7 @@ EOT
])
AT_CLEANUP
-AT_SETUP([quoted coalesced command expansion])
+AT_SETUP([quoted coalesced command substitution])
AT_KEYWORDS([wordsplit wsp wsp-cmd wsp-cmd-4 wsp53])
AT_CHECK([
mkdir dir
@@ -610,7 +610,7 @@ EOT
])
AT_CLEANUP
-AT_SETUP([variable and command expansion])
+AT_SETUP([variable and command substitution])
AT_KEYWORDS([wordsplit wsp wsp-var wsp-var24 wsp-cmd wsp-cmd-5 wsp54])
AT_CHECK([
mkdir dir
@@ -629,7 +629,7 @@ EOT
])
AT_CLEANUP
-AT_SETUP([variable and command expansion in quotes])
+AT_SETUP([variable expansion and command substitution in quotes])
AT_KEYWORDS([wordsplit wsp wsp-var wsp-var25 wsp-cmd wsp-cmd-6 wsp55])
AT_CHECK([
mkdir dir
@@ -645,4 +645,79 @@ EOT
])
AT_CLEANUP
+AT_SETUP([pathname expansion])
+AT_KEYWORDS([wordsplit wsp wsp-path wsp-path-1 wsp56])
+AT_CHECK([
+mkdir dir
+> dir/1.c
+> dir/2.c
+> dir/3.b
+
+wsp pathexpand<<'EOT'
+begin dir/*.c end
+EOT
+],
+[0],
+[NF: 4
+0: begin
+1: dir/1.c
+2: dir/2.c
+3: end
+])
+AT_CLEANUP
+
+AT_SETUP([pathname expansion: no match])
+AT_KEYWORDS([wordsplit wsp wsp-path wsp-path-2 wsp57])
+AT_CHECK([
+mkdir dir
+> dir/1.c
+> dir/2.b
+
+wsp pathexpand<<'EOT'
+begin dir/*.d end
+EOT
+],
+[0],
+[NF: 3
+0: begin
+1: dir/*.d
+2: end
+])
+AT_CLEANUP
+
+AT_SETUP([pathname expansion: nullglob])
+AT_KEYWORDS([wordsplit wsp wsp-path wsp-path-3 wsp58])
+AT_CHECK([
+mkdir dir
+> dir/1.c
+> dir/2.b
+
+wsp pathexpand nullglob<<'EOT'
+begin dir/*.d end
+EOT
+],
+[0],
+[NF: 2
+0: begin
+1: end
+])
+AT_CLEANUP
+
+AT_SETUP([pathname expansion: failglob])
+AT_KEYWORDS([wordsplit wsp wsp-path wsp-path-4 wsp59])
+AT_CHECK([
+mkdir dir
+> dir/1.c
+> dir/2.b
+
+wsp pathexpand failglob<<'EOT'
+begin dir/*.d end
+EOT
+],
+[0],
+[],
+[no files match pattern dir/*.d
+])
+AT_CLEANUP
+
m4_popdef([TESTWSP])

Return to:

Send suggestions and report system problems to the System administrator.