-
Notifications
You must be signed in to change notification settings - Fork 451
Closed
Labels
Component: Bash CodeEverything regarding the bash codeEverything regarding the bash codePriority: CriticalBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorStatus: ConfirmedThe reproducer worked as describedThe reproducer worked as describedType: Bug
Milestone
Description
Describe the bug
With the change bringing in setup_file I noticed my previous mechanism for file global setup that checked the following:
"$BATS_TEST_NAME" = "${BATS_TEST_NAMES[0]}"
was no longer working.
The BATS_TEST_NAME is correct but the BATS_TEST_NAMES array has --tags as its first entry (for some reason I couldn't figure out).
To Reproduce
Steps to reproduce the behavior:
Have a single file with the following:
#!/usr/bin/env bats
setup() {
echo "${BATS_TEST_NAME}" >&3
echo "${BATS_TEST_NAMES[0]}" >&3
}
@test "test" {
echo test >&3
}
Expected behavior
Outputs:
test_test
test_test
test
Instead I get:
test_test
--tags
test
Environment (please complete the following information):
- Bats Version 1.8.2 - 1.9.0
- OS: Linux
- Bash version: 5.2.9
Metadata
Metadata
Assignees
Labels
Component: Bash CodeEverything regarding the bash codeEverything regarding the bash codePriority: CriticalBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorBroken behavior in nearly all environments, e.g. wrong test results, internal bats errorStatus: ConfirmedThe reproducer worked as describedThe reproducer worked as describedType: Bug