Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I here suggest including the check for the Bash version at the beginning of
bats
.Using Bats, I would like to test if Bash frameworks would correctly work in different versions of Bash. I tried to run the test for the devel version of Bash, the latest release 5.2, down to Bash 3.0. However, the test fails because of syntax errors for Bash 3.0 and 3.1. It turned out that the failure is not caused by the Bash frameworks that are tested but by the
bats
test framework itself. I'd like to request Bats to check the Bash version first and output an error message if the minimum Bash version requirement by Bats is not satisfied.I tried to find an explicit notice about the required Bash version, but I couldn't find any information. What is the minimum Bash version supported by Bats? I here assume it is 3.2 because Bats produce syntax errors in Bash 3.0 and 3.1, while some files seem to contain checks for 3.2 (e.g. in
test/trace.bats
).[[ ... ]]
should be always used, but can I use[ ... ]
for the very initial test for the shell? Relying on the Bash feature for the test of whether the Bash feature is available doesn't seem to make sense.[[ ... ]]
and[ ... ]
. However, technically, it might also exclude the uses of the arithmetic commands of the form(( ... ))
. I used the arithmetic command in this PR because arithmetic commands seem to be already used in the codebase.