diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-04-24 16:18:03 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-04-24 16:18:03 +0200 |
commit | cbdff15bb78ba9d83be7f6b5087ee665715999b0 (patch) | |
tree | 6c6728f5b8c3bda7186cbea88a614de2ca26a52b /testsuite/sed.tests | |
parent | 4c8fa34417fd2ccdda6a8ea508a3f1e7fb1d4ceb (diff) | |
download | busybox-w32-cbdff15bb78ba9d83be7f6b5087ee665715999b0.tar.gz busybox-w32-cbdff15bb78ba9d83be7f6b5087ee665715999b0.tar.bz2 busybox-w32-cbdff15bb78ba9d83be7f6b5087ee665715999b0.zip |
sed: understand \n,\r and \t in i and a commands. Closes 8871
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/sed.tests')
-rwxr-xr-x | testsuite/sed.tests | 18 |
1 files changed, 18 insertions, 0 deletions
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" \ | |||
275 | | two \\ | 275 | | two \\ |
276 | ' | 276 | ' |
277 | 277 | ||
278 | testing "sed a cmd understands \\n,\\t,\\r" \ | ||
279 | "sed '/1/a\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \ | ||
280 | "\ | ||
281 | line1 | ||
282 | \t\rzero | ||
283 | one\\\\ntwo\\ | ||
284 | three | ||
285 | " "" "line1\n" | ||
286 | |||
287 | testing "sed i cmd understands \\n,\\t,\\r" \ | ||
288 | "sed '/1/i\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \ | ||
289 | "\ | ||
290 | \t\rzero | ||
291 | one\\\\ntwo\\ | ||
292 | three | ||
293 | line1 | ||
294 | " "" "line1\n" | ||
295 | |||
278 | # first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges | 296 | # first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges |
279 | testing "sed with N skipping lines past ranges on next cmds" \ | 297 | testing "sed with N skipping lines past ranges on next cmds" \ |
280 | "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \ | 298 | "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \ |