summaryrefslogtreecommitdiff
path: root/testsuite/sed.tests
diff options
context:
space:
mode:
authorDenys Vlasenko2009-07-18 16:22:26 +0200
committerDenys Vlasenko2009-07-18 16:22:26 +0200
commit6ae6426a7485b5835c23aea198b3065f491d918b (patch)
tree79ebcee570986e27d7137720ca3139af277a162b /testsuite/sed.tests
parentb71ce023e9527b6afaa497ce62ca53a74cf94cef (diff)
downloadbusybox-6ae6426a7485b5835c23aea198b3065f491d918b.zip
busybox-6ae6426a7485b5835c23aea198b3065f491d918b.tar.gz
fix mountpoint test to not prevemt mkfs_xxx from making image in any file
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/sed.tests')
-rwxr-xr-xtestsuite/sed.tests18
1 files changed, 17 insertions, 1 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests
index 677303b..a9d9ada 100755
--- a/testsuite/sed.tests
+++ b/testsuite/sed.tests
@@ -51,8 +51,10 @@ testing "sed -n" "sed -n -e s/foo/bar/ -e s/bar/baz/" "" "" "foo\n"
testing "sed s//p" "sed -e s/foo/bar/p -e s/bar/baz/p" "bar\nbaz\nbaz\n" \
"" "foo\n"
testing "sed -n s//p" "sed -ne s/abc/def/p" "def\n" "" "abc\n"
+test x"$SKIP_KNOWN_BUGS" = x"" && {
testing "sed s//g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5,\n" \
"" "12345\n"
+}
testing "sed s arbitrary delimiter" "sed -e 's woo boing '" "boing\n" "" "woo\n"
testing "sed s chains" "sed -e s/foo/bar/ -e s/bar/baz/" "baz\n" "" "foo\n"
testing "sed s chains2" "sed -e s/foo/bar/ -e s/baz/nee/" "bar\n" "" "foo\n"
@@ -72,6 +74,7 @@ testing "sed t (test/branch clears test bit)" "sed -e 's/a/b/;:loop;t loop'" \
testing "sed T (!test/branch)" "sed -e 's/a/1/;T notone;p;: notone;p'" \
"1\n1\n1\nb\nb\nc\nc\n" "" "a\nb\nc\n"
+test x"$SKIP_KNOWN_BUGS" = x"" && {
# Normal sed end-of-script doesn't print "c" because n flushed the pattern
# space. If n hits EOF, pattern space is empty when script ends.
# Query: how does this interact with no newline at EOF?
@@ -80,6 +83,7 @@ testing "sed n (flushes pattern space, terminates early)" "sed -e 'n;p'" \
# N does _not_ flush pattern space, therefore c is still in there @ script end.
testing "sed N (doesn't flush pattern space when terminating)" "sed -e 'N;p'" \
"a\nb\na\nb\nc\n" "" "a\nb\nc\n"
+}
testing "sed address match newline" 'sed "/b/N;/b\\nc/i woo"' \
"a\nwoo\nb\nc\nd\n" "" "a\nb\nc\nd\n"
@@ -99,13 +103,17 @@ testing "sed d ends script iteration (2)" \
"sed -e '/ook/d;a\' -e 'bang'" "woot\nbang\n" "" "ook\nwoot\n"
# Multiple files, with varying newlines and NUL bytes
+test x"$SKIP_KNOWN_BUGS" = x"" && {
testing "sed embedded NUL" "sed -e 's/woo/bang/'" "\0bang\0woo\0" "" \
"\0woo\0woo\0"
+}
testing "sed embedded NUL g" "sed -e 's/woo/bang/g'" "bang\0bang\0" "" \
"woo\0woo\0"
+test x"$SKIP_KNOWN_BUGS" = x"" && {
echo -e "/woo/a he\0llo" > sed.commands
testing "sed NUL in command" "sed -f sed.commands" "woo\nhe\0llo\n" "" "woo"
rm sed.commands
+}
# sed has funky behavior with newlines at the end of file. Test lots of
# corner cases with the optional newline appending behavior.
@@ -120,8 +128,10 @@ testing "sed empty file plus cat" "sed -e 's/nohit//' input -" "one\ntwo" \
"" "one\ntwo"
testing "sed cat plus empty file" "sed -e 's/nohit//' input -" "one\ntwo" \
"one\ntwo" ""
+test x"$SKIP_KNOWN_BUGS" = x"" && {
testing "sed append autoinserts newline" "sed -e '/woot/a woo' -" \
"woot\nwoo\n" "" "woot"
+}
testing "sed insert doesn't autoinsert newline" "sed -e '/woot/i woo' -" \
"woo\nwoot" "" "woot"
testing "sed print autoinsert newlines" "sed -e 'p' -" "one\none" "" "one"
@@ -137,9 +147,11 @@ testing "sed selective matches insert newline" \
testing "sed selective matches noinsert newline" \
"sed -ne 's/woo/bang/p' input -" "a bang\nb bang" "a woo\nb woo" \
"c no\nd no"
+test x"$SKIP_KNOWN_BUGS" = x"" && {
testing "sed clusternewline" \
"sed -e '/one/a 111' -e '/two/i 222' -e p input -" \
"one\none\n111\n222\ntwo\ntwo" "one" "two"
+}
testing "sed subst+write" \
"sed -e 's/i/z/' -e 'woutputw' input -; echo -n X; cat outputw" \
"thzngy\nagaznXthzngy\nagazn" "thingy" "again"
@@ -175,8 +187,12 @@ testing "sed lie-to-autoconf" "sed --version | grep -o 'GNU sed version '" \
"GNU sed version \n" "" ""
# Jump to nonexistent label
-testing "sed nonexistent label" "sed -e 'b walrus' 2> /dev/null || echo yes" \
+test x"$SKIP_KNOWN_BUGS" = x"" && {
+# Incompatibility: illegal jump is not detected if input is ""
+# (that is, no lines at all). GNU sed 4.1.5 complains even in this case
+testing "sed nonexistent label" "sed -e 'b walrus' 2>/dev/null || echo yes" \
"yes\n" "" ""
+}
testing "sed backref from empty s uses range regex" \
"sed -e '/woot/s//eep \0 eep/'" "eep woot eep" "" "woot"