aboutsummaryrefslogtreecommitdiff
path: root/testsuite/sed.tests
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/sed.tests')
-rwxr-xr-xtestsuite/sed.tests24
1 files changed, 22 insertions, 2 deletions
diff --git a/testsuite/sed.tests b/testsuite/sed.tests
index 5d2356b64..a71f8b1f0 100755
--- a/testsuite/sed.tests
+++ b/testsuite/sed.tests
@@ -135,10 +135,12 @@ testing "sed empty file plus cat" "sed -e 's/nohit//' input -" "one\ntwo" \
135 "" "one\ntwo" 135 "" "one\ntwo"
136testing "sed cat plus empty file" "sed -e 's/nohit//' input -" "one\ntwo" \ 136testing "sed cat plus empty file" "sed -e 's/nohit//' input -" "one\ntwo" \
137 "one\ntwo" "" 137 "one\ntwo" ""
138test x"$SKIP_KNOWN_BUGS" = x"" && {
139testing "sed append autoinserts newline" "sed -e '/woot/a woo' -" \ 138testing "sed append autoinserts newline" "sed -e '/woot/a woo' -" \
140 "woot\nwoo\n" "" "woot" 139 "woot\nwoo\n" "" "woot"
141} 140testing "sed append autoinserts newline 2" "sed -e '/oot/a woo' - input" \
141 "woot\nwoo\nboot\nwoo\n" "boot" "woot"
142testing "sed append autoinserts newline 3" "sed -e '/oot/a woo' -i input && cat input" \
143 "boot\nwoo\n" "boot" ""
142testing "sed insert doesn't autoinsert newline" "sed -e '/woot/i woo' -" \ 144testing "sed insert doesn't autoinsert newline" "sed -e '/woot/i woo' -" \
143 "woo\nwoot" "" "woot" 145 "woo\nwoot" "" "woot"
144testing "sed print autoinsert newlines" "sed -e 'p' -" "one\none" "" "one" 146testing "sed print autoinsert newlines" "sed -e 'p' -" "one\none" "" "one"
@@ -275,6 +277,24 @@ testing "sed a cmd ended by double backslash" \
275 | two \\ 277 | two \\
276' 278'
277 279
280testing "sed a cmd understands \\n,\\t,\\r" \
281 "sed '/1/a\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \
282"\
283line1
284\t\rzero
285one\\\\ntwo\\
286three
287" "" "line1\n"
288
289testing "sed i cmd understands \\n,\\t,\\r" \
290 "sed '/1/i\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \
291"\
292\t\rzero
293one\\\\ntwo\\
294three
295line1
296" "" "line1\n"
297
278# first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges 298# first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges
279testing "sed with N skipping lines past ranges on next cmds" \ 299testing "sed with N skipping lines past ranges on next cmds" \
280 "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \ 300 "sed -n '1{N;N;d};1p;2,3p;3p;4p'" \