summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2022-10-23 09:58:40 -0700
committerJim Meyering <meyering@fb.com>2022-10-23 23:10:26 -0700
commit59c6f17a719b5425f4defb3d9219210cfc676709 (patch)
tree8c6ee7b525ccebbd9b4160ddff6452d1aa428694
parentf5abeba48e4c93fc8df4c81e7ae2a61f469ed5e1 (diff)
downloadsed-59c6f17a719b5425f4defb3d9219210cfc676709.tar.gz
test: add a test case and mention the change in NEWS
* testsuite/misc.pl: Add a test to exercise the preceding change. * NEWS (Changes in behavior): Mention it.
-rw-r--r--NEWS8
-rw-r--r--testsuite/misc.pl2
2 files changed, 10 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index bdabc68..8428f31 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,14 @@ GNU sed NEWS -*- outline -*-
The 'r' command now accepts address 0, allowing inserting a file before
the first line.
+** Changes in behavior
+
+ Sed now prints the less-surprising variant in a corner case of
+ POSIX-unspecified behavior. Before, this would print "n".
+ Now, it prints "X":
+
+ printf n | sed 'sn\nnXn'; echo
+
* Noteworthy changes in release 4.8 (2020-01-14) [stable]
diff --git a/testsuite/misc.pl b/testsuite/misc.pl
index 64ac57b..e60b812 100644
--- a/testsuite/misc.pl
+++ b/testsuite/misc.pl
@@ -1197,6 +1197,8 @@ s,.*[^\/],,
['bug30794_1', "s/z/\\\\x5cA/", {IN=>'z'}, {OUT => "\\A"}],
['bug30794_2', "s/z/\\\\x5c/", {IN=>'z'}, {OUT => "\\"}],
['bug30794_3', "s/z/\\\\x5c1/", {IN=>'z'}, {OUT => "\\1"}],
+
+ ['bug40242', q('sn\nnXn'), {IN=>'n'}, {OUT => 'X'}],
);
my $save_temps = $ENV{SAVE_TEMPS};