Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Lines splitting now does not glob; closes sstephenson/bats#207 #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libexec/bats-exec-test
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ run() {
output="$("$@" 2>&1)"
status="$?"
oldIFS=$IFS
IFS=$'\n' lines=($output)
IFS=$'\n' readarray -t lines <<< "$output"
[ -z "$e" ] || set -e
[ -z "$E" ] || set -E
[ -z "$T" ] || set -T
Expand Down
14 changes: 10 additions & 4 deletions test/bats.bats
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ fixtures bats
@test "summary passing tests" {
run filter_control_sequences bats -p $FIXTURE_ROOT/passing.bats
[ $status -eq 0 ]
[ "${lines[1]}" = "1 test, 0 failures" ]
[ "${lines[2]}" = "1 test, 0 failures" ]
}

@test "summary passing and skipping tests" {
run filter_control_sequences bats -p $FIXTURE_ROOT/passing_and_skipping.bats
[ $status -eq 0 ]
[ "${lines[2]}" = "2 tests, 0 failures, 1 skipped" ]
[ "${lines[3]}" = "2 tests, 0 failures, 1 skipped" ]
}

@test "summary passing and failing tests" {
run filter_control_sequences bats -p $FIXTURE_ROOT/failing_and_passing.bats
[ $status -eq 0 ]
[ "${lines[4]}" = "2 tests, 1 failure" ]
[ "${lines[5]}" = "2 tests, 1 failure" ]
}

@test "summary passing, failing and skipping tests" {
run filter_control_sequences bats -p $FIXTURE_ROOT/passing_failing_and_skipping.bats
[ $status -eq 0 ]
[ "${lines[5]}" = "3 tests, 1 failure, 1 skipped" ]
[ "${lines[6]}" = "3 tests, 1 failure, 1 skipped" ]
}

@test "one failing test" {
Expand Down Expand Up @@ -262,3 +262,9 @@ fixtures bats
[ $status -eq 0 ]
[ "${lines[1]}" = "ok 1 loop_func" ]
}

@test "testing quoting in lines splitting works" {
run echo '*'
[ "${lines[0]}" = "*" ]
[ "$output" = "*" ]
}