all: unset ksh errors
commit0f96cf63657968d8ae8eccc3164b9ebd28235b7b
authorKyle J. McKay <mackyle@gmail.com>
Wed, 31 May 2017 12:18:58 +0000 (31 05:18 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Wed, 31 May 2017 12:18:58 +0000 (31 05:18 -0700)
treea9c629cf6af0825f927b89c0b27e9794fd6a5733
parent2dd610fe4d488f2866ff5b8aed8b293491fab788
all: unset ksh errors

If the shell is ksh then this:

  unset it && unset it && echo good || echo bad

Outputs "bad" instead of "good".

POSIX clearly stipulates that using unset on a variable
that has never be set is NOT an error and MUST NOT cause
a non-zero status.

Tolerate this brokennes by using an internal 'unset_' function
that ignores any unset error status or the 'sane_unset' function
in test scripts or by adding an explicit '|| :' where neither of
those may be expected to be available.

Add a t0002-sanity test to document this (and possibly other future)
"tolerate_failure" issues.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
t/helper/branch_needs_update.sh
t/helper/navigate_deps.sh
t/helper/recurse_deps_internal.sh
t/t0001-testlib-basic.sh
t/t0002-sanity.sh [new file with mode: 0755]
t/t1200-index-merge-one-file.sh
t/test-lib-functions-tg.sh
t/test-lib-functions.sh
t/test-lib-main.sh
t/test-lib.sh
tg.sh