Ignore:
Timestamp:
Dec 20, 2016, 4:07:32 PM (7 years ago)
Author:
Bruno Cornec
Message:

New 3?3 banch for incorporation of latest busybox 1.25. Changing minor version to handle potential incompatibilities.

Location:
branches/3.3
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/testsuite/sed.tests

    r3232 r3621  
    136136testing "sed cat plus empty file" "sed -e 's/nohit//' input -" "one\ntwo" \
    137137    "one\ntwo" ""
    138 test x"$SKIP_KNOWN_BUGS" = x"" && {
    139138testing "sed append autoinserts newline" "sed -e '/woot/a woo' -" \
    140139    "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" ""
    142144testing "sed insert doesn't autoinsert newline" "sed -e '/woot/i woo' -" \
    143145    "woo\nwoot" "" "woot"
     
    155157    "sed -ne 's/woo/bang/p' input -" "a bang\nb bang" "a woo\nb woo" \
    156158    "c no\nd no"
    157 test x"$SKIP_KNOWN_BUGS" = x"" && {
    158159testing "sed clusternewline" \
    159160    "sed -e '/one/a 111' -e '/two/i 222' -e p input -" \
    160161    "one\none\n111\n222\ntwo\ntwo" "one" "two"
    161 }
    162162testing "sed subst+write" \
    163163    "sed -e 's/i/z/' -e 'woutputw' input -; $ECHO -n X; cat outputw" \
     
    278278'
    279279
     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
    280298# first three lines are deleted; 4th line is matched and printed by "2,3" and by "4" ranges
    281299testing "sed with N skipping lines past ranges on next cmds" \
     
    311329    "qwerty_\n" "" "qwerty\n"
    312330
     331testing "sed /\$_in_regex/ should not match newlines, only end-of-line" \
     332    "sed ': testcont; /\\\\$/{ =; N; b testcont }'" \
     333    "\
     334this is a regular line
     3352
     336line with \\
     337continuation
     338more regular lines
     3395
     340line with \\
     341continuation
     342" \
     343    "" "\
     344this is a regular line
     345line with \\
     346continuation
     347more regular lines
     348line with \\
     349continuation
     350"
     351
     352testing "sed s///NUM test" \
     353    "sed -e 's/a/b/2; s/a/c/g'" \
     354    "cb\n" "" "aa\n"
     355
     356testing "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
     362testing "sed /regex/,+N{...} addresses work" \
     363    "sed /^2/,+2{d}" \
     364    "1\n5\n" \
     365    "" \
     366    "1\n2\n3\n4\n5\n"
     367
     368testing "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
     375testing "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
     382testing "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
     388testing "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
    313394# testing "description" "commands" "result" "infile" "stdin"
    314395
Note: See TracChangeset for help on using the changeset viewer.