OILS / stdlib / osh / two-test.sh View on Github | oilshell.org

37 lines, 23 significant
1#!/usr/bin/env bash
2
3set -o nounset
4set -o pipefail
5set -o errexit
6
7: ${LIB_OSH=stdlib/osh}
8
9source $LIB_OSH/two.sh # module under test
10
11source $LIB_OSH/no-quotes.sh
12source $LIB_OSH/task-five.sh
13
14test-log() {
15 local status stderr
16
17 nq-capture-2 status stderr \
18 log hi
19
20 nq-assert 'hi' = "$stderr"
21 nq-assert 0 = "$status"
22}
23
24test-die() {
25 local status
26
27 # This calls exit, so we don't use nq-capture
28
29 set +o errexit
30 ( die "bad" )
31 status=$?
32 set -o errexit
33
34 nq-assert 1 -eq "$status"
35}
36
37task-five "$@"