diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-09-01 01:59:11 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-09-01 01:59:11 +0200 |
commit | 76d72376e0244a5cafd4880cdc623e37d86a75e4 (patch) | |
tree | 30335e94c8585150c89e5bab1d02986422fea4de /testsuite | |
parent | 9ff910de6be59eec120158de0b4721701877a9b1 (diff) | |
download | busybox-w32-76d72376e0244a5cafd4880cdc623e37d86a75e4.tar.gz busybox-w32-76d72376e0244a5cafd4880cdc623e37d86a75e4.tar.bz2 busybox-w32-76d72376e0244a5cafd4880cdc623e37d86a75e4.zip |
sed: fix "sed n (flushes pattern space, terminates early)" testcase failure
Patch based on work by Dengke Du <dengke.du@windriver.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/sed.tests | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests index a71f8b1f0..05c00a99b 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests | |||
@@ -73,13 +73,9 @@ testing "sed t (test/branch clears test bit)" "sed -e 's/a/b/;:loop;t loop'" \ | |||
73 | testing "sed T (!test/branch)" "sed -e 's/a/1/;T notone;p;: notone;p'" \ | 73 | testing "sed T (!test/branch)" "sed -e 's/a/1/;T notone;p;: notone;p'" \ |
74 | "1\n1\n1\nb\nb\nc\nc\n" "" "a\nb\nc\n" | 74 | "1\n1\n1\nb\nb\nc\nc\n" "" "a\nb\nc\n" |
75 | 75 | ||
76 | test x"$SKIP_KNOWN_BUGS" = x"" && { | ||
77 | # Normal sed end-of-script doesn't print "c" because n flushed the pattern | ||
78 | # space. If n hits EOF, pattern space is empty when script ends. | ||
79 | # Query: how does this interact with no newline at EOF? | ||
80 | testing "sed n (flushes pattern space, terminates early)" "sed -e 'n;p'" \ | 76 | testing "sed n (flushes pattern space, terminates early)" "sed -e 'n;p'" \ |
81 | "a\nb\nb\nc\n" "" "a\nb\nc\n" | 77 | "a\nb\nb\nc\n" "" "a\nb\nc\n" |
82 | } | 78 | |
83 | # non-GNU sed: N does _not_ flush pattern space, therefore c is eaten @ script end | 79 | # non-GNU sed: N does _not_ flush pattern space, therefore c is eaten @ script end |
84 | # GNU sed: N flushes pattern space, therefore c is printed too @ script end | 80 | # GNU sed: N flushes pattern space, therefore c is printed too @ script end |
85 | testing "sed N (flushes pattern space (GNU behavior))" "sed -e 'N;p'" \ | 81 | testing "sed N (flushes pattern space (GNU behavior))" "sed -e 'N;p'" \ |