aboutsummaryrefslogtreecommitdiff
path: root/tests/wordsplit.at
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wordsplit.at')
-rw-r--r--tests/wordsplit.at69
1 files changed, 62 insertions, 7 deletions
diff --git a/tests/wordsplit.at b/tests/wordsplit.at
index 895a392..49d47e9 100644
--- a/tests/wordsplit.at
+++ b/tests/wordsplit.at
@@ -637,6 +637,14 @@ NF: 1
[input exhausted
])
+TESTWSP([incremental nosplit],[],[incremental nosplit],
+[incremental "input test" line
+],
+[NF: 1
+0: "incremental \"input test\" line"
+],
+[input exhausted
+])
dnl Something that doesn't fit into TESTWSP
@@ -717,15 +725,16 @@ mkdir dir
> dir/file
DIR=dir wsp -nocmd -novar<<'EOT'
-begin $(find $DIR) end
+begin $DIR $(find $DIR) end
EOT
],
[0],
-[NF: 4
+[NF: 5
0: begin
1: dir
-2: dir/file
-3: end
+2: dir
+3: dir/file
+4: end
])
AT_CLEANUP
@@ -735,8 +744,8 @@ AT_CHECK([
mkdir dir
> dir/file
-DIR=dir wsp -nocmd -novar<<'EOT'
-"begin($(find $DIR))end"
+DIR=dir BEGIN=begin wsp -nocmd -novar<<'EOT'
+"${BEGIN}($(find $DIR))end"
EOT
],
[0],
@@ -744,7 +753,27 @@ EOT
0: "begin(dir dir/file)end"
])
AT_CLEANUP
-
+
+AT_SETUP([nested commands])
+AT_KEYWORDS([wordsplit wsp wsp-cmd])
+AT_CHECK([
+AT_DATA([input],[foo
+bar
+baz
+])
+SUFFIX=put wsp -nocmd -novar <<'EOT'
+$(echo output $(cat in$SUFFIX))
+EOT
+],
+[0],
+[NF: 4
+0: output
+1: foo
+2: bar
+3: baz
+])
+AT_CLEANUP
+
AT_SETUP([pathname expansion])
AT_KEYWORDS([wordsplit wsp wsp-path wsp-path-1])
AT_CHECK([
@@ -820,6 +849,32 @@ EOT
])
AT_CLEANUP
+TESTWSP([append],[],[-- extra arguments follow],
+[some words and],
+[NF: 6
+0: some
+1: words
+2: and
+3: extra
+4: arguments
+5: follow
+])
+
+TESTWSP([append + dooffs + env],[],
+[dooffs 2 preface words V=2 -- extra arguments follow],
+[some words and var=$V],
+[NF: 7 (2)
+(0): preface
+(1): words
+2: some
+3: words
+4: and
+5: var=2
+6: extra
+7: arguments
+8: follow
+])
+
m4_popdef([TESTWSP])
m4_popdef([wspnum])
m4_popdef([wspid])

Return to:

Send suggestions and report system problems to the System administrator.