From 665a65953076ea21be49250b8279ddb1f0f99f38 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 2 Dec 2020 19:07:31 +0100 Subject: awk: FS regex matches only non-empty separators (gawk compat) function old new delta awk_split 484 553 +69 Signed-off-by: Denys Vlasenko --- testsuite/awk.tests | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'testsuite') diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 87f6b5007..06a531d96 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -398,5 +398,12 @@ testing 'awk do not allow "str"++' \ '' \ 'anything' +#gawk compat: FS regex matches only non-empty separators: +#with -*, the splitting is NOT f o o b a r, but foo bar: +testing 'awk FS regex which can match empty string' \ + "awk -F '-*' '{print \$1 \"-\" \$2 \"=\" \$3 \"*\" \$4}'" \ + "foo-bar=*\n" \ + '' \ + 'foo--bar' exit $FAILCOUNT -- cgit v1.2.3