aboutsummaryrefslogtreecommitdiff
path: root/tests/wordsplit.at
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-05-13 14:24:58 +0300
committerSergey Poznyakoff <gray@gnu.org>2019-05-13 14:52:18 +0300
commit07930c5ee74b8d2645fc55465833ab84e2f4444a (patch)
tree45ca5b8b787987a9c6a5980bddd7d6db13e070c7 /tests/wordsplit.at
parent3e07e3ad30e8a7a091e213eb4df839b7cf7f1e64 (diff)
downloadgrecs-07930c5ee74b8d2645fc55465833ab84e2f4444a.tar.gz
grecs-07930c5ee74b8d2645fc55465833ab84e2f4444a.tar.bz2
wordsplit: return single empty string on empty input in WRDSF_NOSPLIT mode
* src/wordsplit.c (wordsplit_finish): Make sure at one non-null argument is always returned in WRDSF_NOSPLIT mode. * tests/wordsplit.at: Add new test.
Diffstat (limited to 'tests/wordsplit.at')
-rw-r--r--tests/wordsplit.at13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/wordsplit.at b/tests/wordsplit.at
index 631d939..e3af703 100644
--- a/tests/wordsplit.at
+++ b/tests/wordsplit.at
@@ -264,3 +264,3 @@ TOTAL: 2
-TESTWSP([nosplit with expansion],[wsp-var-nosplit],[nosplit],
+TESTWSP([nosplit with variable expansion],[wsp-var-nosplit],[nosplit],
[a $FOO test],
@@ -273,3 +273,3 @@ TOTAL: 1
-TESTWSP([nosplit without expansion],[],[nosplit novar],
+TESTWSP([nosplit without variable expansion],[],[nosplit novar],
[a $FOO test],
@@ -282,2 +282,11 @@ TOTAL: 1
+TESTWSP([nosplit: empty expansion],[],[nosplit trimnl],
+[$FOO],
+[NF: 1
+0: ""
+TOTAL: 1
+],
+[],
+[FOO=""])
+
TESTWSP([default value (defined)],[],[],

Return to:

Send suggestions and report system problems to the System administrator.