From cbdff15bb78ba9d83be7f6b5087ee665715999b0 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 24 Apr 2016 16:18:03 +0200 Subject: sed: understand \n,\r and \t in i and a commands. Closes 8871 Signed-off-by: Denys Vlasenko --- testsuite/sed.tests | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'testsuite/sed.tests') diff --git a/testsuite/sed.tests b/testsuite/sed.tests index 5d2356b64..c4b6fa278 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests @@ -275,6 +275,24 @@ testing "sed a cmd ended by double backslash" \ | two \\ ' +testing "sed a cmd understands \\n,\\t,\\r" \ + "sed '/1/a\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \ +"\ +line1 +\t\rzero +one\\\\ntwo\\ +three +" "" "line1\n" + +testing "sed i cmd understands \\n,\\t,\\r" \ + "sed '/1/i\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \ +"\ +\t\rzero +one\\\\ntwo\\ +three +line1 +" "" "line1\n" + # first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges testing "sed with N skipping lines past ranges on next cmds" \ "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \ -- cgit v1.2.3