[Toybox] Test design issue.

enh enh at google.com
Tue Apr 25 10:28:39 PDT 2017


note that the existing SKIP_HOST mechanism is very error prone. iirc none
of the sed tests actually run because one near the top needs SKIP_HOST and
it never gets unset.

SKIP_HOST is also not very intention-revealing. i'd prefer to explicitly
distinguish "host tool is just plain broken" from "we deliberately chose to
diverge [because ...]".

cases like sh.test are awkward too... exponentiation is a bash extension to
the more widespread arithmetic extension (which is all the test tests). so
although it's "sh.test", it explicitly invokes "bash". and if you "fix" it
by running sh, bash-as-sh fails too. for now i just have an explicit case
to skip sh.test in my Android toybox test runner, but in an ideal world it
would be more fine-grained than that.

here though, is there a strong reason to prefer \e? otherwise why not just
do what the host does in this case?

On Mon, Apr 24, 2017 at 3:18 PM, Rob Landley <rob at landley.net> wrote:

> I want an ls.test checking "ls -b" via some variant of:
>
> mkdir blah
> touch blah/"$(echo -e "$(X=0;while [ $X -lt 255 ];do X=$(($X+1));[ $X
> -eq 47 ]&& continue;printf '\\x%02x' $X; done)")"
> ls -b blah
>
> And then make sure it's escaping everything it should, but the ubuntu
> 14.04 ls -b  and toybox's ls -b have one difference: for ascii 27 (the
> escape char) ubuntu says "\033" and toybox says "\e".
>
> I guess I can break it into 3 tests with the middle one SKIP_HOST? Seems
> awkward...
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
>



-- 
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20170425/17873f3e/attachment-0003.htm>


More information about the Toybox mailing list