testsuite: sed, is sed test item 12345 is a known bug?

Denys Vlasenko vda.linux at googlemail.com
Thu Feb 10 10:53:06 UTC 2011


On Wed, Feb 9, 2011 at 4:27 AM,  <macpaul at andestech.com> wrote:
> Hi all,
>
> I'm checking the busybox test suite.
> I have some problems and I will post all of them later on the mailing list.
>
> 1st: about sed.
> ./runtest -v sed.tests
>
> I have got problem on this test:
> echo -ne '12345\n' | sed -e 's/[[:space:]]*/,/g'
> FAIL: sed s//g (exhaustive)
> --- expected
> +++ actual
> @@ -1 +1 @@
> -,1,2,3,4,5,
> +,12345
>
> The original test script is:
> testing "sed s//g (exhaustive)" "sed -e 's/[[:space:]]*/,/g'" ",1,2,3,4,5,\n" \
>        "" "12345\n"
>
> When executing test script, the verbose output will have:
> /bin/testsuite # echo -ne '12345\n' | sed -e 's/[[:space:]]*/,/g'
> After I ran this in the shell I will have
> ,12345
>
> If I replace the command as the follows I will got correct output.
> /bin/testsuite # echo -ne '1 2 3 4 5\n' | sed -e 's/[[:space:]]*/,/g'
> ,1,2,3,4,5
>
> Should the test script be fixed?

No. It tests that even empty string matches [[:space:]]*
Currently, we do have an incompatibility with GNU sed there:

$ echo 12345 | sed -e 's/[[:space:]]*/,/g'
,1,2,3,4,5,

$ echo 12345 | busybox sed -e 's/[[:space:]]*/,/g'
,12345

*This* needs fixing, not testcase.

-- 
vda


More information about the busybox mailing list