testlib: make test-lib-main.sh pure functions
commita1c65da4f22313dfcf2c7698a58f1136cf8bc78a
authorKyle J. McKay <mackyle@gmail.com>
Thu, 15 Dec 2016 08:21:10 +0000 (15 00:21 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Thu, 15 Dec 2016 08:21:10 +0000 (15 00:21 -0800)
tree928ce7cfe23e5ab6ae4bd23a6281f1b1a60d73bc
parentfb7449d290e3a50106b2c047c93f8ee458a20c00
testlib: make test-lib-main.sh pure functions

Make the code in test-lib-main.sh exclusively function
definitions so that it can be safely re-read at any time without
causing any harm.

This also guarantees that any state it uses may be saved and
restored indpendently of defining the functions themselves.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
t/test-lib-main.sh
t/test-lib.sh