]>
Commit | Line | Data |
---|---|---|
71aad674 A |
1 | # $FreeBSD$ |
2 | ||
3 | failures= | |
4 | failure() { | |
5 | echo "Error at line $1" >&2 | |
6 | failures=x$failures | |
7 | } | |
8 | ||
9 | T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) || exit | |
10 | trap 'rm -rf $T' 0 | |
11 | cd $T || exit 3 | |
12 | unset x | |
13 | echo 'x=2' >testscript | |
14 | . ./testscript | |
15 | [ "$x" = 2 ] || failure $LINENO | |
16 | cd / || exit 3 | |
17 | x=1 | |
18 | PATH=$T:$PATH . testscript | |
19 | [ "$x" = 2 ] || failure $LINENO | |
20 | ||
21 | test -z "$failures" |