Test pathname expansion

This commit is contained in:
Sergey Poznyakoff 2014-10-24 11:31:20 +03:00
parent 00301604fd
commit 731d730447

View file

@ -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])