fix than his, and shrank the code a bit on top of that so the net size is
smaller, and added a test to the test suite for this case. Plus I cleaned up
the #includes and removed unnecessary "const"s while I was there.
we can run our own testsuite under, and I want it to handle the full range of
strange and peverted behavior you can find in real world shell scripts.
In the meantime, I'll just say #!/bin/bash in places that may care.
- 'function fn_name\n{' breaks on older FreeBSD default shells, so use the more
widely supported 'fn_name () {'. This needs more fixing..
- test for integers ought to use the proper operators
- test for strings ought to use quoting of the strings to be fair to strange
implementations of test(1)
- make sure not to ignore return-codes != 0 from commands; Some shells exit
immediately on this (much like explicitely requesting set -e in e.g. bash)
TODO:
*) Some older shells do not allow a space after the test-condition in an "if"
statement. This doesn't work:
if [ $status -ne 0 ] ; then
as opposed to this:
if [ $status -ne 0 ]; then
or this
if [ $status -ne 0 ]
then
*) strict spacing between commands. In some shells you have to say:
foo ; bar ; baz
The affected shells barf on stuff like ommitting the space, so this doesn't
work:
foo; bar ;baz
*) $() vs. ``
The former isn't really portable as opposed to the latter.
*) fix frong assumption that the testsuite is run from the source-dir.
This is a complete misconception and renders the testsuite completely useless.
That said, i note that IMO a test-harness ought to do it's best to work in
a wide variety of environments, everything else defeats it's purpose.
it looks like the introduced support for character classes and
equivalence classes is not correct. The attached patch tries to fix
some symptoms and tries to make tr behave like gnu tr for the added
test cases. The patch
- removes if clauses with side effects
- fixes handling of buffer pointer (strcat added characters to the
buffer without increasing the buffer pointer)
- re-arranges character classes to match ASCII order
regards,
Jean
$COMMAND environment variable, instead put full command line (including
command to run) in second argument. Modify $PATH to have test versions of
commands at start of path. (Also more infrastructure for testing as root,
work in progress...)
meaning we want to run them in a chroot environment. To help with this,
I worked out a utility function that makes it really easy to set up a chroot
environment.