Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/testsuite/sed.tests
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/testsuite/sed.tests
r3232 r3621 136 136 testing "sed cat plus empty file" "sed -e 's/nohit//' input -" "one\ntwo" \ 137 137 "one\ntwo" "" 138 test x"$SKIP_KNOWN_BUGS" = x"" && {139 138 testing "sed append autoinserts newline" "sed -e '/woot/a woo' -" \ 140 139 "woot\nwoo\n" "" "woot" 141 } 140 testing "sed append autoinserts newline 2" "sed -e '/oot/a woo' - input" \ 141 "woot\nwoo\nboot\nwoo\n" "boot" "woot" 142 testing "sed append autoinserts newline 3" "sed -e '/oot/a woo' -i input && cat input" \ 143 "boot\nwoo\n" "boot" "" 142 144 testing "sed insert doesn't autoinsert newline" "sed -e '/woot/i woo' -" \ 143 145 "woo\nwoot" "" "woot" … … 155 157 "sed -ne 's/woo/bang/p' input -" "a bang\nb bang" "a woo\nb woo" \ 156 158 "c no\nd no" 157 test x"$SKIP_KNOWN_BUGS" = x"" && {158 159 testing "sed clusternewline" \ 159 160 "sed -e '/one/a 111' -e '/two/i 222' -e p input -" \ 160 161 "one\none\n111\n222\ntwo\ntwo" "one" "two" 161 }162 162 testing "sed subst+write" \ 163 163 "sed -e 's/i/z/' -e 'woutputw' input -; $ECHO -n X; cat outputw" \ … … 278 278 ' 279 279 280 testing "sed a cmd understands \\n,\\t,\\r" \ 281 "sed '/1/a\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \ 282 "\ 283 line1 284 \t\rzero 285 one\\\\ntwo\\ 286 three 287 " "" "line1\n" 288 289 testing "sed i cmd understands \\n,\\t,\\r" \ 290 "sed '/1/i\\\\t\\rzero\\none\\\\ntwo\\\\\\nthree'" \ 291 "\ 292 \t\rzero 293 one\\\\ntwo\\ 294 three 295 line1 296 " "" "line1\n" 297 280 298 # first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges 281 299 testing "sed with N skipping lines past ranges on next cmds" \ … … 311 329 "qwerty_\n" "" "qwerty\n" 312 330 331 testing "sed /\$_in_regex/ should not match newlines, only end-of-line" \ 332 "sed ': testcont; /\\\\$/{ =; N; b testcont }'" \ 333 "\ 334 this is a regular line 335 2 336 line with \\ 337 continuation 338 more regular lines 339 5 340 line with \\ 341 continuation 342 " \ 343 "" "\ 344 this is a regular line 345 line with \\ 346 continuation 347 more regular lines 348 line with \\ 349 continuation 350 " 351 352 testing "sed s///NUM test" \ 353 "sed -e 's/a/b/2; s/a/c/g'" \ 354 "cb\n" "" "aa\n" 355 356 testing "sed /regex/,N{...} addresses work" \ 357 "sed /^2/,2{d}" \ 358 "1\n3\n4\n5\n" \ 359 "" \ 360 "1\n2\n3\n4\n5\n" 361 362 testing "sed /regex/,+N{...} addresses work" \ 363 "sed /^2/,+2{d}" \ 364 "1\n5\n" \ 365 "" \ 366 "1\n2\n3\n4\n5\n" 367 368 testing "sed /regex/,+N{...} -i works" \ 369 "cat - >input2; sed /^4/,+2{d} -i input input2; echo \$?; cat input input2; rm input2" \ 370 "0\n""1\n2\n3\n7\n8\n""1\n2\n7\n8\n" \ 371 "1\n2\n3\n4\n5\n6\n7\n8\n" \ 372 "1\n2\n4\n5\n6\n7\n8\n" \ 373 374 # GNU sed 4.2.1 would also accept "/^4/,+{d}" with the same meaning, we don't 375 testing "sed /regex/,+0{...} -i works" \ 376 "cat - >input2; sed /^4/,+0{d} -i input input2; echo \$?; cat input input2; rm input2" \ 377 "0\n""1\n2\n3\n5\n6\n7\n8\n""1\n2\n5\n6\n7\n8\n" \ 378 "1\n2\n3\n4\n5\n6\n7\n8\n" \ 379 "1\n2\n4\n5\n6\n7\n8\n" \ 380 381 # GNU sed 4.2.1 would also accept "/^4/,+d" with the same meaning, we don't 382 testing "sed /regex/,+0<cmd> -i works" \ 383 "cat - >input2; sed /^4/,+0d -i input input2; echo \$?; cat input input2; rm input2" \ 384 "0\n""1\n2\n3\n5\n6\n7\n8\n""1\n2\n5\n6\n7\n8\n" \ 385 "1\n2\n3\n4\n5\n6\n7\n8\n" \ 386 "1\n2\n4\n5\n6\n7\n8\n" \ 387 388 testing "sed 's///w FILE'" \ 389 "sed 's/qwe/ZZZ/wz'; cat z; rm z" \ 390 "123\nZZZ\nasd\n""ZZZ\n" \ 391 "" \ 392 "123\nqwe\nasd\n" 393 313 394 # testing "description" "commands" "result" "infile" "stdin" 314 395
Note:
See TracChangeset
for help on using the changeset viewer.