diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-01 04:14:46 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-01 04:14:46 +0200 |
commit | 2e284a40bcb9d5c73b86603fe31f3a175023d88a (patch) | |
tree | 136dd1fc079bebe47954e8fab8d99e5376d7d9af /testsuite | |
parent | 138ce54c9c1930348bc842be781accd7c50c2cef (diff) | |
download | busybox-w32-2e284a40bcb9d5c73b86603fe31f3a175023d88a.tar.gz busybox-w32-2e284a40bcb9d5c73b86603fe31f3a175023d88a.tar.bz2 busybox-w32-2e284a40bcb9d5c73b86603fe31f3a175023d88a.zip |
sed: fix sed -i: unlike without -i, it does not forget ranges
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/sed.tests | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests index 3301a25f8..445eff6bc 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests | |||
@@ -270,11 +270,16 @@ testing "sed a cmd ended by double backslash" \ | |||
270 | | two \\ | 270 | | two \\ |
271 | ' | 271 | ' |
272 | 272 | ||
273 | # fisrt three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges | 273 | # first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges |
274 | testing "sed with N skipping lines past ranges on next cmds" \ | 274 | testing "sed with N skipping lines past ranges on next cmds" \ |
275 | "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \ | 275 | "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \ |
276 | "4\n4\n" "" "1\n2\n3\n4\n" | 276 | "4\n4\n" "" "1\n2\n3\n4\n" |
277 | 277 | ||
278 | testing "sed -i with address modifies all files, not only first" \ | ||
279 | "cp input input2; sed -i -e '1s/foo/bar/' input input2 && cat input input2; rm input2" \ | ||
280 | "bar\nbar\n" "foo\n" "foo\n" | ||
281 | |||
282 | |||
278 | # testing "description" "arguments" "result" "infile" "stdin" | 283 | # testing "description" "arguments" "result" "infile" "stdin" |
279 | 284 | ||
280 | exit $FAILCOUNT | 285 | exit $FAILCOUNT |