diff options
Diffstat (limited to 'testsuite/sed.tests')
-rwxr-xr-x | testsuite/sed.tests | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests index 875c946be..88b9c4e4b 100755 --- a/testsuite/sed.tests +++ b/testsuite/sed.tests | |||
@@ -110,7 +110,7 @@ testing "sed embedded NUL" "sed -e 's/woo/bang/'" "\0bang\0woo\0" "" \ | |||
110 | testing "sed embedded NUL g" "sed -e 's/woo/bang/g'" "bang\0bang\0" "" \ | 110 | testing "sed embedded NUL g" "sed -e 's/woo/bang/g'" "bang\0bang\0" "" \ |
111 | "woo\0woo\0" | 111 | "woo\0woo\0" |
112 | test x"$SKIP_KNOWN_BUGS" = x"" && { | 112 | test x"$SKIP_KNOWN_BUGS" = x"" && { |
113 | echo -e "/woo/a he\0llo" > sed.commands | 113 | $ECHO -e "/woo/a he\0llo" > sed.commands |
114 | testing "sed NUL in command" "sed -f sed.commands" "woo\nhe\0llo\n" "" "woo" | 114 | testing "sed NUL in command" "sed -f sed.commands" "woo\nhe\0llo\n" "" "woo" |
115 | rm sed.commands | 115 | rm sed.commands |
116 | } | 116 | } |
@@ -153,7 +153,7 @@ testing "sed clusternewline" \ | |||
153 | "one\none\n111\n222\ntwo\ntwo" "one" "two" | 153 | "one\none\n111\n222\ntwo\ntwo" "one" "two" |
154 | } | 154 | } |
155 | testing "sed subst+write" \ | 155 | testing "sed subst+write" \ |
156 | "sed -e 's/i/z/' -e 'woutputw' input -; echo -n X; cat outputw" \ | 156 | "sed -e 's/i/z/' -e 'woutputw' input -; $ECHO -n X; cat outputw" \ |
157 | "thzngy\nagaznXthzngy\nagazn" "thingy" "again" | 157 | "thzngy\nagaznXthzngy\nagazn" "thingy" "again" |
158 | rm outputw | 158 | rm outputw |
159 | testing "sed trailing NUL" \ | 159 | testing "sed trailing NUL" \ |
@@ -248,4 +248,28 @@ testing "sed beginning (^) matches only once" \ | |||
248 | ">/usr</>lib<\n" "" \ | 248 | ">/usr</>lib<\n" "" \ |
249 | "/usr/lib\n" | 249 | "/usr/lib\n" |
250 | 250 | ||
251 | testing "sed c" \ | ||
252 | "sed 'crepl'" \ | ||
253 | "repl\nrepl\n" "" \ | ||
254 | "first\nsecond\n" | ||
255 | |||
256 | testing "sed nested {}s" \ | ||
257 | "sed '/asd/ { p; /s/ { s/s/c/ }; p; q }'" \ | ||
258 | "qwe\nasd\nacd\nacd\n" "" \ | ||
259 | "qwe\nasd\nzxc\n" | ||
260 | |||
261 | testing "sed a cmd ended by double backslash" \ | ||
262 | "sed -e '/| one /a \\ | ||
263 | | three \\\\' -e '/| one-/a \\ | ||
264 | | three-* \\\\'" \ | ||
265 | ' | one \\ | ||
266 | | three \\ | ||
267 | | two \\ | ||
268 | ' '' \ | ||
269 | ' | one \\ | ||
270 | | two \\ | ||
271 | ' | ||
272 | |||
273 | # testing "description" "arguments" "result" "infile" "stdin" | ||
274 | |||
251 | exit $FAILCOUNT | 275 | exit $FAILCOUNT |