Skip to content

Commit 7e2db2b

Browse files
committed
tests/vars: Disable Bats shell options for setup
Part of #156. Very minor O(0.05s) benefit, but every little bit counts, especially on Windows.
1 parent 85c521a commit 7e2db2b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/vars.bats

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ quotify_expected() {
2727
run "$TEST_GO_SCRIPT" vars
2828
assert_success
2929

30+
set "$DISABLE_BATS_SHELL_OPTIONS"
3031
local search_paths=("[0]=\"$_GO_CORE_DIR/libexec\""
3132
"[1]=\"$TEST_GO_SCRIPTS_DIR\"")
3233

@@ -59,10 +60,12 @@ quotify_expected() {
5960
"declare -rx _GO_USE_MODULES=\"$_GO_CORE_DIR/lib/internal/use\"")
6061

6162
quotify_expected
63+
restore_bats_shell_options "$?"
6264
assert_lines_equal "${expected[@]}"
6365
}
6466

6567
@test "$SUITE: all _GO_* variables for Bash subcommand contain values" {
68+
set "$DISABLE_BATS_SHELL_OPTIONS"
6669
@go.create_test_command_script 'test-command.d/test-subcommand' \
6770
'. "$_GO_USE_MODULES" "module_0" "module_1"' \
6871
'@go vars'
@@ -131,6 +134,7 @@ quotify_expected() {
131134
"declare -rx _GO_USE_MODULES=\"$_GO_CORE_DIR/lib/internal/use\"")
132135

133136
quotify_expected
137+
restore_bats_shell_options "$?"
134138
assert_lines_equal "${expected[@]}"
135139
}
136140

0 commit comments

Comments
 (0)