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

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