Skip to content

Commit

Permalink
Merge pull request sstephenson#158 from vonbrand/dont-glob-output
Browse files Browse the repository at this point in the history
Don't glob output
  • Loading branch information
martin-schulze-vireso authored Jul 24, 2021
2 parents 2e2e5df + 14e8b32 commit 5218bbc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bats-core/test_functions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ load() {
run() {
trap bats_interrupt_trap_in_run INT
local origFlags="$-"
set +eET
set -f +eET
local origIFS="$IFS"
# 'output', 'status', 'lines' are global variables available to tests.
# shellcheck disable=SC2034
Expand Down
15 changes: 15 additions & 0 deletions test/bats.bats
Original file line number Diff line number Diff line change
Expand Up @@ -986,3 +986,18 @@ EOF
[[ "${lines[5]}" == "# Received SIGINT, aborting ..." ]]
[[ "${lines[6]}" == "# bats warning: Executed 2 instead of expected 1 tests" ]]
}


@test "single star in output is not treated as a glob" {
star(){ echo '*'; }

run star
[ "${lines[0]}" = '*' ]
}

@test "multiple stars in output are not treated as a glob" {
stars(){ echo '**'; }

run stars
[ "${lines[0]}" = '**' ]
}

0 comments on commit 5218bbc

Please sign in to comment.