Skip to content

Commit 18d31d7

Browse files
committed
bash: test that bash invocation outputs no errors
1 parent 2b5426e commit 18d31d7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/bash-test.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,19 @@ __clean_shell() {
1414
}
1515

1616
test_interactive_login_shell() {
17-
__clean_shell --login -i -c true || fail_test "error in bash init for interactive login shell"
17+
local stdout
18+
stdout=$(__clean_shell --login -i -c true 2>&1)
19+
local status=$?
20+
[[ $status = 0 ]] || fail_test "error in bash init for interactive login shell"
21+
assert_equal '' "$stdout"
1822
}
1923

2024
test_interactive_nonlogin_shell() {
21-
__clean_shell -i -c true || fail_test "error in bash init for interactive non-login shell"
25+
local stdout
26+
stdout=$(__clean_shell -i -c true 2>&1)
27+
local status=$?
28+
[[ $status = 0 ]] || fail_test "error in bash init for interactive non-login shell"
29+
assert_equal '' "$stdout"
2230
}
2331

2432
TEST_SOURCE=$0 source test/support/suite.sh

0 commit comments

Comments
 (0)