diff options
author | Rob Landley <rob@landley.net> | 2006-02-23 23:13:16 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-02-23 23:13:16 +0000 |
commit | 6b6edf959dfeb8cacf101b6cc7db25e8d809f633 (patch) | |
tree | 81b3f3df3f2a5bcad021747d6ea8f873222dfd24 | |
parent | b21837714a3765137bfad16e139bf7b9d6fbbcc6 (diff) | |
download | busybox-w32-6b6edf959dfeb8cacf101b6cc7db25e8d809f633.tar.gz busybox-w32-6b6edf959dfeb8cacf101b6cc7db25e8d809f633.tar.bz2 busybox-w32-6b6edf959dfeb8cacf101b6cc7db25e8d809f633.zip |
Lots of tests the fix to sed needs to pass...
-rwxr-xr-x | testsuite/sed.tests | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests index 479dd9ae7..1f2208200 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests | |||
@@ -98,6 +98,41 @@ testing "sed d ends script iteration" \ | |||
98 | testing "sed d ends script iteration (2)" \ | 98 | testing "sed d ends script iteration (2)" \ |
99 | "-e '/ook/d;a\' -e 'bang'" "woot\nbang\n" "" "ook\nwoot\n" | 99 | "-e '/ook/d;a\' -e 'bang'" "woot\nbang\n" "" "ook\nwoot\n" |
100 | 100 | ||
101 | # Multiple files, with varying newlines and NUL bytes | ||
102 | testing "sed embedded NUL" "-e 's/woo/bang/'" "\0bang\0woo\0" "" "\0woo\0woo\0" | ||
103 | |||
104 | # sed has funky behavior with newlines at the end of file. Test lots of | ||
105 | # corner cases with the optional newline appending behavior. | ||
106 | |||
107 | testing "sed normal newlines" "-e 's/woo/bang/' input -" "bang\nbang\n" \ | ||
108 | "woo\n" "woo\n" | ||
109 | testing "sed leave off trailing newline" "-e 's/woo/bang/' input -" \ | ||
110 | "bang\nbang" "woo\n" "woo" | ||
111 | testing "sed autoinsert newline" "-e 's/woo/bang/' input -" "bang\nbang" \ | ||
112 | "woo" "woo" | ||
113 | testing "sed empty file plus cat" "-e 's/nohit//' input -" "one\ntwo" \ | ||
114 | "" "one\ntwo" | ||
115 | testing "sed cat plus empty file" "-e 's/nohit//' input -" "one\ntwo" \ | ||
116 | "one\ntwo" "" | ||
117 | testing "sed append autoinserts newline" "-e '/woot/a woo' -" "woot\nwoo\n" \ | ||
118 | "" "woot" | ||
119 | testing "sed insert doesn't autoinsert newline" "-e '/woot/i woo' -" \ | ||
120 | "woo\nwoot" "" "woot" | ||
121 | testing "sed print autoinsert newlines" "-e 'p' -" "one\none" "" "one" | ||
122 | testing "sed print autoinsert newlines two files" "-e 'p' input -" \ | ||
123 | "one\none\ntwo\ntwo" "one" "two" | ||
124 | |||
125 | testing "sed noprint, no match, no newline" "-ne 's/woo/bang/' input" \ | ||
126 | "" "no\n" "" | ||
127 | testing "sed selective matches with nl" "-ne 's/woo/bang/p' input -" \ | ||
128 | "a bang\nc bang\n" "a woo\nb no" "c woo\nd no" | ||
129 | testing "sed selective matches insert newline" "-ne 's/woo/bang/p' input -" \ | ||
130 | "a bang\nb bang\nd bang" "a woo\nb woo" "c no\nd woo" | ||
131 | testing "sed selective matches noinsert newline" "-ne 's/woo/bang/p' input -" \ | ||
132 | "a bang\nb bang" "a woo\nb woo" "c no\nd no" | ||
133 | testing "sed clusternewline" "-e '/one/a 111' -e '/two/i 222' -e p input -" \ | ||
134 | "one\none\n111\n222\ntwo\ntwo" "one" "two" | ||
135 | |||
101 | # Ponder this a bit more, why "woo not found" from gnu version? | 136 | # Ponder this a bit more, why "woo not found" from gnu version? |
102 | #testing "sed doesn't substitute in deleted line" \ | 137 | #testing "sed doesn't substitute in deleted line" \ |
103 | # "-e '/ook/d;s/ook//;t woo;a bang;'" "bang" "" "ook\n" | 138 | # "-e '/ook/d;s/ook//;t woo;a bang;'" "bang" "" "ook\n" |