aboutsummaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-08-16 13:29:34 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2011-08-16 13:29:34 +0200
commita7d6bb3b5df1a0a2be2f48583ffc01b1f62d73af (patch)
tree9686d41000d765d9aead067d704d1efb362c9575 /testsuite
parent4f54168ea21216f1ca322d343a26ee3e568444d9 (diff)
downloadbusybox-a7d6bb3b5df1a0a2be2f48583ffc01b1f62d73af.tar.gz
sed: fix range handling for sed -i. Closes 4069
function old new delta sed_main 606 618 +12 add_cmd 1099 1101 +2 process_files 2108 2099 -9 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/1 up/down: 14/-9) Total: 5 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/sed.tests10
1 files changed, 7 insertions, 3 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests
index e9d0ed601..ba163e9e9 100755
--- a/testsuite/sed.tests
+++ b/testsuite/sed.tests
@@ -6,7 +6,7 @@
. ./testing.sh
-# testing "description" "arguments" "result" "infile" "stdin"
+# testing "description" "commands" "result" "infile" "stdin"
# Corner cases
testing "sed no files (stdin)" 'sed ""' "hello\n" "" "hello\n"
@@ -225,7 +225,7 @@ testing "sed s/xxx/[/" "sed -e 's/xxx/[/'" "[\n" "" "xxx\n"
#testing "sed -g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5," \
# "" "12345"
-# testing "description" "arguments" "result" "infile" "stdin"
+# testing "description" "commands" "result" "infile" "stdin"
testing "sed n command must reset 'substituted' bit" \
"sed 's/1/x/;T;n;: next;s/3/y/;t quit;n;b next;: quit;q'" \
@@ -291,6 +291,10 @@ testing "sed understands \r" \
"sed 's/r/\r/'" \
"\rrr\n" "" "rrr\n"
-# testing "description" "arguments" "result" "infile" "stdin"
+testing "sed -i finishes ranges correctly" \
+ "sed '1,2d' -i input; echo \$?; cat input" \
+ "0\n3\n4\n" "1\n2\n3\n4\n" ""
+
+# testing "description" "commands" "result" "infile" "stdin"
exit $FAILCOUNT