aboutsummaryrefslogtreecommitdiff
path: root/tests/wordsplit.at
diff options
context:
space:
mode:
Diffstat (limited to 'tests/wordsplit.at')
-rw-r--r--tests/wordsplit.at122
1 files changed, 63 insertions, 59 deletions
diff --git a/tests/wordsplit.at b/tests/wordsplit.at
index 1f2e80d..ebd168b 100644
--- a/tests/wordsplit.at
+++ b/tests/wordsplit.at
@@ -110,3 +110,3 @@ dnl Test worsplit-specific behavior
110dnl ------------------------------------------------------------ 110dnl ------------------------------------------------------------
111TESTWSP([append],[wsp-append],[append], 111TESTWSP([append],[wsp-append],[-append],
112[jeden dwa trzy 112[jeden dwa trzy
@@ -135,3 +135,3 @@ TOTAL: 2
135 135
136TESTWSP([dooffs],[wsp-doofs ],[dooffs 3 jeden dwa trzy], 136TESTWSP([dooffs],[wsp-doofs ],[-dooffs jeden dwa trzy],
137[cztery piec], 137[cztery piec],
@@ -216,3 +216,3 @@ TOTAL: 3
216 216
217TESTWSP([undefined variables 2],[],[keepundef], 217TESTWSP([undefined variables 2],[],[-keepundef],
218[a $FOO test a${FOO}b], 218[a $FOO test a${FOO}b],
@@ -228,3 +228,3 @@ TOTAL: 4
228 228
229TESTWSP([warn about undefined variables],[],[warnundef], 229TESTWSP([warn about undefined variables],[],[-warnundef],
230[$FOO], 230[$FOO],
@@ -237,3 +237,3 @@ TOTAL: 0
237 237
238TESTWSP([bail out on undefined variables],[],[undef], 238TESTWSP([bail out on undefined variables],[],[-undef],
239[$FOO], 239[$FOO],
@@ -244,3 +244,3 @@ TESTWSP([bail out on undefined variables],[],[undef],
244 244
245TESTWSP([disable variable expansion],[],[novar], 245TESTWSP([disable variable expansion],[],[-novar],
246[$FOO], 246[$FOO],
@@ -254,3 +254,3 @@ TOTAL: 1
254TESTWSP([K/V environment],[wsp-env-kv wsp-env_kv], 254TESTWSP([K/V environment],[wsp-env-kv wsp-env_kv],
255[env_kv], 255[-env_kv],
256[$FOO a$BAZ], 256[$FOO a$BAZ],
@@ -264,3 +264,3 @@ TOTAL: 2
264 264
265TESTWSP([nosplit with variable expansion],[wsp-var-nosplit],[nosplit], 265TESTWSP([nosplit with variable expansion],[wsp-var-nosplit],[-nosplit],
266[a $FOO test], 266[a $FOO test],
@@ -273,3 +273,3 @@ TOTAL: 1
273 273
274TESTWSP([nosplit without variable expansion],[],[nosplit novar], 274TESTWSP([nosplit without variable expansion],[],[-nosplit -novar],
275[a $FOO test], 275[a $FOO test],
@@ -282,3 +282,3 @@ TOTAL: 1
282 282
283TESTWSP([nosplit: empty expansion],[],[nosplit trimnl], 283TESTWSP([nosplit: empty expansion],[],[-nosplit -trimnl],
284[$FOO], 284[$FOO],
@@ -291,11 +291,2 @@ TOTAL: 1
291 291
292TESTWSP([default value (defined)],[],[],
293[${FOO:-bar}],
294[NF: 1
2950: qux
296TOTAL: 1
297],
298[],
299[FOO=qux])
300
301TESTWSP([default value],[],[], 292TESTWSP([default value],[],[],
@@ -453,3 +444,3 @@ WSPGROUP()
453 444
454TESTWSP([ignore quotes],[wsp-ignore-quotes ],[-quote], 445TESTWSP([ignore quotes],[wsp-ignore-quotes ],[-noquote],
455["a text"], 446["a text"],
@@ -464,3 +455,3 @@ WSPGROUP(wsp-delim)
464TESTWSP([custom delimiters (squeeze)],[], 455TESTWSP([custom delimiters (squeeze)],[],
465[delim : -ws trimnl], 456[-delim : -nows -trimnl],
466[semicolon: separated::list: of :words], 457[semicolon: separated::list: of :words],
@@ -476,3 +467,3 @@ TOTAL: 5
476TESTWSP([custom delimiters (no squeeze)],[], 467TESTWSP([custom delimiters (no squeeze)],[],
477[delim : -ws -squeeze_delims trimnl], 468[-delim : -nows -nosqueeze_delims -trimnl],
478[semicolon: separated::list: of :words], 469[semicolon: separated::list: of :words],
@@ -489,3 +480,3 @@ TOTAL: 6
489TESTWSP([custom, with returned delimiters],[], 480TESTWSP([custom, with returned delimiters],[],
490[delim : -ws trimnl return_delims], 481[-delim : -nows -trimnl -return_delims],
491[semicolon: separated::list: of :words], 482[semicolon: separated::list: of :words],
@@ -505,3 +496,3 @@ TOTAL: 9
505TESTWSP([custom, with returned & squeezed delimiters],[], 496TESTWSP([custom, with returned & squeezed delimiters],[],
506[delim : -ws trimnl return_delims -squeeze_delims], 497[-delim : -nows -trimnl -return_delims -nosqueeze_delims],
507[semicolon: separated::list: of :words], 498[semicolon: separated::list: of :words],
@@ -523,3 +514,3 @@ WSPGROUP(wsp-sed)
523 514
524TESTWSP([sed expressions],[],[sed], 515TESTWSP([sed expressions],[],[-sed],
525[arg1 s/foo/bar/g;s/bar baz/quz quux/ arg2], 516[arg1 s/foo/bar/g;s/bar baz/quz quux/ arg2],
@@ -534,3 +525,3 @@ WSPGROUP()
534 525
535TESTWSP([C escapes on],[wcp-c-escape],[cescapes], 526TESTWSP([C escapes on],[wcp-c-escape],[-cescapes],
536[a\ttab form\ffeed and new\nline], 527[a\ttab form\ffeed and new\nline],
@@ -544,3 +535,3 @@ TOTAL: 4
544 535
545TESTWSP([C escapes off],[wcp-c-escape-off],[-cescapes], 536TESTWSP([C escapes off],[wcp-c-escape-off],[-nocescapes],
546[a\ttab form\ffeed and new\nline], 537[a\ttab form\ffeed and new\nline],
@@ -554,3 +545,3 @@ TOTAL: 4
554 545
555TESTWSP([ws elimination],[wsp-ws-elim],[delim ' ()' ws return_delims], 546TESTWSP([ws elimination],[wsp-ws-elim],[-delim ' ()' -ws -return_delims],
556[( list items )], 547[( list items )],
@@ -565,3 +556,3 @@ TOTAL: 4
565TESTWSP([ws elimination + return delim],[wsp-ws-elim-ret], 556TESTWSP([ws elimination + return delim],[wsp-ws-elim-ret],
566[-default novar nocmd delim ":," return_delims ws dquote], 557[-nodefault -novar -nocmd -delim ":," -return_delims -ws -dquote],
567["foo" : "bar", "quux" : "baaz" ], 558["foo" : "bar", "quux" : "baaz" ],
@@ -578,3 +569,3 @@ TOTAL: 7
578 569
579TESTWSP([empty quotes],[wsp-empty-quotes],[delim : ws return_delims], 570TESTWSP([empty quotes],[wsp-empty-quotes],[-delim : -ws -return_delims],
580[t=""], 571[t=""],
@@ -586,3 +577,3 @@ TOTAL: 1
586TESTWSP([delimiter following empty quotes], 577TESTWSP([delimiter following empty quotes],
587[],[delim : ws return_delims], 578[],[-delim : -ws -return_delims],
588[t="":r], 579[t="":r],
@@ -597,3 +588,3 @@ TESTWSP([suppress ws trimming within quotes],
597[], 588[],
598[default delim , ws return_delims], 589[-default -delim , -ws -return_delims],
599[nocomponent,nonewline, formatfield="In message %{text}, "], 590[nocomponent,nonewline, formatfield="In message %{text}, "],
@@ -610,3 +601,3 @@ TESTWSP([unescape],
610[wsp-unescape wsp-unescape-simple], 601[wsp-unescape wsp-unescape-simple],
611[-default novar nocmd quote escape ':+:\\""'], 602[-nodefault -novar -nocmd -quote -escape ':+:\\""'],
612[\Seen "quote \"" "bs \\"], 603[\Seen "quote \"" "bs \\"],
@@ -621,3 +612,3 @@ TESTWSP([unescape: word/quote],
621[wsp-unescape wsp-unescape-word], 612[wsp-unescape wsp-unescape-word],
622[-default novar nocmd quote escape-word '\\""' escape-quote ':+0x:\\""'], 613[-nodefault -novar -nocmd -quote -escape-word '\\""' -escape-quote ':+0x:\\""'],
623[\Seen "quote \"" "bs \\" "3\x31 \101" 3\x31 \101], 614[\Seen "quote \"" "bs \\" "3\x31 \101" 3\x31 \101],
@@ -633,3 +624,3 @@ TOTAL: 6
633 624
634TESTWSP([dquote],[],[-default novar nocmd dquote], 625TESTWSP([dquote],[],[-nodefault -novar -nocmd -dquote],
635[a "quoted example" isn't it], 626[a "quoted example" isn't it],
@@ -643,3 +634,3 @@ TOTAL: 4
643 634
644TESTWSP([squote],[],[-default novar nocmd squote], 635TESTWSP([squote],[],[-nodefault -novar -nocmd -squote],
645[a 'quoted example' isn"t it], 636[a 'quoted example' isn"t it],
@@ -655,3 +646,3 @@ WSPGROUP(wsp-incr)
655 646
656TESTWSP([incremental],[],[incremental], 647TESTWSP([incremental],[],[-incremental],
657[incremental "input test" line 648[incremental "input test" line
@@ -673,3 +664,3 @@ TOTAL: 3
673 664
674TESTWSP([incremental append],[],[incremental append], 665TESTWSP([incremental append],[],[-incremental -append],
675[incremental "input test" line 666[incremental "input test" line
@@ -695,3 +686,3 @@ TOTAL: 3
695TESTWSP([incremental ws], 686TESTWSP([incremental ws],
696[],[return_delims -squeeze_delims incremental ws], 687[],[-return_delims -nosqueeze_delims -incremental -ws],
697[a list test 688[a list test
@@ -713,3 +704,3 @@ TOTAL: 3
713 704
714TESTWSP([incremental nosplit],[],[incremental nosplit], 705TESTWSP([incremental nosplit],[],[-incremental -nosplit],
715[incremental "input test" line 706[incremental "input test" line
@@ -723,3 +714,3 @@ TOTAL: 1
723 714
724TESTWSP([simple command substitution],[],[-nocmd], 715TESTWSP([simple command substitution],[],[-cmd],
725[begin $(words a b) end], 716[begin $(words a b) end],
@@ -733,3 +724,3 @@ TOTAL: 4
733 724
734TESTWSP([quoted command substitution],[],[-nocmd], 725TESTWSP([quoted command substitution],[],[-cmd],
735[begin "$(words a b)" end], 726[begin "$(words a b)" end],
@@ -742,3 +733,3 @@ TOTAL: 3
742 733
743TESTWSP([coalesced command substitution],[],[-nocmd], 734TESTWSP([coalesced command substitution],[],[-cmd],
744[begin($(words a b))end], 735[begin($(words a b))end],
@@ -750,3 +741,3 @@ TOTAL: 2
750 741
751TESTWSP([quoted coalesced command substitution],[],[-nocmd], 742TESTWSP([quoted coalesced command substitution],[],[-cmd],
752["begin($(words a b))end"], 743["begin($(words a b))end"],
@@ -757,3 +748,3 @@ TOTAL: 1
757 748
758TESTWSP([variable and command substitution],[],[-nocmd -novar], 749TESTWSP([variable and command substitution],[],[-cmd -var],
759[begin $X $(words $X $Y) end], 750[begin $X $(words $X $Y) end],
@@ -768,3 +759,3 @@ TOTAL: 5
768 759
769TESTWSP([variable expansion and command substitution in quotes],[],[-nocmd -novar], 760TESTWSP([variable expansion and command substitution in quotes],[],[-cmd -var],
770["${BEGIN}($(words $X $Y))end"], 761["${BEGIN}($(words $X $Y))end"],
@@ -775,3 +766,3 @@ TOTAL: 1
775 766
776TESTWSP([nested commands],[],[-nocmd -novar], 767TESTWSP([nested commands],[],[-cmd -var],
777[$(words output $(words in$SUFFIX text) end)], 768[$(words output $(words in$SUFFIX text) end)],
@@ -794,3 +785,3 @@ mkdir dir
794 785
795wsp pathexpand<<'EOT' 786wsp -pathexpand<<'EOT'
796begin dir/*.c end 787begin dir/*.c end
@@ -815,3 +806,3 @@ mkdir dir
815 806
816wsp pathexpand<<'EOT' 807wsp -pathexpand<<'EOT'
817begin dir/*.d end 808begin dir/*.d end
@@ -835,3 +826,3 @@ mkdir dir
835 826
836wsp pathexpand nullglob<<'EOT' 827wsp -pathexpand -nullglob<<'EOT'
837begin dir/*.d end 828begin dir/*.d end
@@ -854,3 +845,3 @@ mkdir dir
854 845
855wsp pathexpand failglob<<'EOT' 846wsp -pathexpand -failglob<<'EOT'
856begin dir/*.d end 847begin dir/*.d end
@@ -864,3 +855,3 @@ AT_CLEANUP
864 855
865TESTWSP([append],[],[-- extra arguments follow], 856TESTWSP([append],[],[-append-args extra arguments follow],
866[some words and], 857[some words and],
@@ -877,3 +868,3 @@ TOTAL: 3
877TESTWSP([append + dooffs + env],[], 868TESTWSP([append + dooffs + env],[],
878[-env dooffs 2 preface words V=2 -- extra arguments follow], 869[-env none -dooffs preface words -- V=2 -append-args extra arguments follow],
879[some words and var=$V], 870[some words and var=$V],
@@ -894,3 +885,3 @@ TOTAL: 4
894TESTWSP([maxwords],[], 885TESTWSP([maxwords],[],