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

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