Home

test.sh

POSIX compliant, TAP producing, sh(1) testing library

Usage

#!/bin/sh

. ./test.sh

test "one plus zero is zero"
sum=$((1+0))
[ $sum -eq 0 ]

test "one plus one is two"
sum=$((1+1))
[ $sum -eq 2 ]

test "one plus one is three"
sum=$((1+1))
[ $sum -eq 3 ]

test "two plus two is four"
sum=$((2+2))
[ $sum -eq 4 ]

Output

not ok 1 - one plus zero is zero
ok 2 - one plus one is one
not ok 3 - one plus one is three
ok 4 - two plus two is four
1..4

Notes

Overriding the test(1) command is intentional and using the alternate [ form is recommended in tests.

Known issues

Due to the fact that the previous test is computed on the next test call, the output from the current test(if any) is shown before its message.

Files

Download

test.sh-1.0.tgz