aboutsummaryrefslogtreecommitdiff
path: root/testsuite/sed.tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/sed.tests')
-rwxr-xr-xtestsuite/sed.tests18
1 files changed, 16 insertions, 2 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests
index 9fa8e190c..468565f47 100755
--- a/testsuite/sed.tests
+++ b/testsuite/sed.tests
@@ -52,10 +52,8 @@ testing "sed with empty match" "sed 's/z*//g'" "string\n" "" "string\n"
52testing "sed s//p" "sed -e s/foo/bar/p -e s/bar/baz/p" "bar\nbaz\nbaz\n" \ 52testing "sed s//p" "sed -e s/foo/bar/p -e s/bar/baz/p" "bar\nbaz\nbaz\n" \
53 "" "foo\n" 53 "" "foo\n"
54testing "sed -n s//p" "sed -ne s/abc/def/p" "def\n" "" "abc\n" 54testing "sed -n s//p" "sed -ne s/abc/def/p" "def\n" "" "abc\n"
55test x"$SKIP_KNOWN_BUGS" = x"" && {
56testing "sed s//g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5,\n" \ 55testing "sed s//g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5,\n" \
57 "" "12345\n" 56 "" "12345\n"
58}
59testing "sed s arbitrary delimiter" "sed -e 's woo boing '" "boing\n" "" "woo\n" 57testing "sed s arbitrary delimiter" "sed -e 's woo boing '" "boing\n" "" "woo\n"
60testing "sed s chains" "sed -e s/foo/bar/ -e s/bar/baz/" "baz\n" "" "foo\n" 58testing "sed s chains" "sed -e s/foo/bar/ -e s/bar/baz/" "baz\n" "" "foo\n"
61testing "sed s chains2" "sed -e s/foo/bar/ -e s/baz/nee/" "bar\n" "" "foo\n" 59testing "sed s chains2" "sed -e s/foo/bar/ -e s/baz/nee/" "bar\n" "" "foo\n"
@@ -296,6 +294,22 @@ testing "sed -i finishes ranges correctly" \
296 "sed '1,2d' -i input; echo \$?; cat input" \ 294 "sed '1,2d' -i input; echo \$?; cat input" \
297 "0\n3\n4\n" "1\n2\n3\n4\n" "" 295 "0\n3\n4\n" "1\n2\n3\n4\n" ""
298 296
297testing "sed zero chars match/replace advances correctly 1" \
298 "sed 's/l*/@/g'" \
299 "@h@e@o@\n" "" "helllo\n"
300
301testing "sed zero chars match/replace advances correctly 2" \
302 "sed 's [^ .]* x g'" \
303 "x x.x\n" "" " a.b\n"
304
305testing "sed zero chars match/replace logic must not falsely trigger here 1" \
306 "sed 's/a/A/g'" \
307 "_AAA1AA\n" "" "_aaa1aa\n"
308
309testing "sed zero chars match/replace logic must not falsely trigger here 2" \
310 "sed 's/ *$/_/g'" \
311 "qwerty_\n" "" "qwerty\n"
312
299# testing "description" "commands" "result" "infile" "stdin" 313# testing "description" "commands" "result" "infile" "stdin"
300 314
301exit $FAILCOUNT 315exit $FAILCOUNT