blob: f0fb0edbc084ceee258ec87083bbf906e45b026b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
#!/bin/bash
. "$XDG_TEST_DIR/include/testassertions.sh"
. "$XDG_TEST_DIR/include/testcontrol.sh"
test_var_bleed_set() {
test_start "$FUNCNAME: set the BLEEDTEST variable"
test_procedure
export BLEED1=i_am_set
BLEED2=set
assert_exit 0 export BLEED3="set_within_assert_exit"
test_result
}
test_var_bleed_read() {
test_start "$FUNCNAME: read the BLEEDTEST variable"
test_procedure
assert_exit 0 echo -n "$BLEED1"
assert_nostdout
assert_nostderr
assert_exit 0 echo -n "$BLEED2"
assert_nostdout
assert_nostderr
assert_exit 0 echo -n "$BLEED3"
assert_nostdout
assert_nostderr
assert_exit 0 echo -n "$BLEED4"
assert_nostdout
assert_nostderr
test_result
}
test_stdout_capture() {
test_start "$FUNCNAME: stdout capture test. note: FAIL=PASS"
assert_exit 0 echo -n "some output"
assert_nostdout
assert_nostderr
test_result
}
run_test test_var_bleed_set
run_test test_var_bleed_read
run_test test_stdout_capture
|