[Toybox] [PATCH][TEST] ls -d should not follow symlink

Rob Landley rob at landley.net
Thu Oct 30 15:01:59 PDT 2014


On 10/30/14 11:11, Isaac Dunham wrote:
> Test ls -d to make sure it does not follow links.

I looked at that this morning but didn't update it because some of the
existing tests are failing, so I have to go through the whole thing and
poke at it, and right now I'm doing sed.tests. :)

(I don't have a "pending" mechanism for tests. I suspect doing a proper
pedantic thorough cleanup and fill-out pass on the test suite is going
to be either right before 1.0 or right after it.)

Looking closer at ls.tests, the "ls -a" test is failing because the dot
entries are at the end instead of the beginning. Except that behavior is
locale dependent at the best of times, if I do

  LC_ALL=c TEST_HOST=1 scripts/test.sh ls

Now the _host_ ls is failing the tests. Probaby we want to run the
output through "sort" to get stable behavior out of it.

Also there are 26 command line options (not counting --color), and 16
tests in testing. So what's there is unlikely to be all that thorough...

Proper test suite entries can eat an _amazing_ amount of time if you let
them. The possible pedantic nitpicking is just amazing, a _proper_ test
suite will do "ls doesnotexit 2>/dev/null || echo err" and  "ls >
/dev/full 2>/dev/null || echo err" and so on. Not just testing what
should work but what _shouldn't_, testing that failures are caught and
errors are reported.

Toybox needs to be simple, needs to be compact, needs to implement all
the appropriate functionality, needs to be robust about catching
failures and reporting errors, needs to have good help text for each
command explaining what it does and how to use it, needs error messages
that don't expect the reader to know more that a couple dozen words of
english (about the level C keywords or posix command names already
require), needs its internals well documented, needs a thorough test
suite, and this is before you get into making utf8 work and supporting
nommu systems and bootloader embedding and how we don't want to rely on
any external libraries but _would_ like to support https and there's
still no decent embedded stunnel implementation around...

If you wonder why it's taking so much time, there's an awful lot to do.

Thanks for the update though. :)

> --
> On Thu, Oct 30, 2014 at 05:37:35AM -0500, Rob Landley wrote:
>> Got it.
>> http://landley.net/hg/toybox/rev/1540
>> Thanks,
>> Rob
> 
> Also, looking at man 1p ls, it looks like -HL takes priority over -dFl.
> (Yes, -F also implies not following links.)

By my reading of the spec, -HL is supposed to take priority?

I checked in adding -F.

> Thanks,
> Isaac Dunham

Thanks,

Rob

 1414706519.0


More information about the Toybox mailing list