+
Skip to content
Merged
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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@

[![Join the chat in bats-core/bats-core on gitter](https://badges.gitter.im/bats-core/bats-core.svg)][gitter]

Bats is a [TAP](https://testanything.org/)-compliant testing framework for Bash. It provides a simple
way to verify that the UNIX programs you write behave as expected.
Bats is a [TAP](https://testanything.org/)-compliant testing framework for Bash
3.2 or above. It provides a simple way to verify that the UNIX programs you
write behave as expected.

A Bats test file is a Bash script with special syntax for defining test cases.
Under the hood, each test case is just a function with a description.
Expand Down
13 changes: 13 additions & 0 deletions bin/bats
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

set -euo pipefail

# Note: We first need to use POSIX's `[ ... ]' instead of Bash's `[[ ... ]]'
# because this is the check for Bash, where the shell may not be Bash. Once we
# confirm that we are in Bash, we can use [[ ... ]] and (( ... )). Note that
# these [[ ... ]] and (( ... )) do not cause syntax errors in POSIX shells,
# though they can be parsed differently.
if [ -z "${BASH_VERSION-}" ] ||
[[ -z "${BASH_VERSINFO-}" ]] ||
((BASH_VERSINFO[0] < 3 || (BASH_VERSINFO[0] == 3 && BASH_VERSINFO[1] < 2)))
then
printf 'bats: this program needs to be run by Bash >= 3.2\n' >&2
exit 1
fi

if command -v greadlink >/dev/null; then
bats_readlinkf() {
greadlink -f "$1"
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ The format is based on [Keep a Changelog][kac] and this project adheres to
* add security.md (#762)
* add codespell CI checks (#720)
* dynamic test registration via `bats_test_function` (#349)
* add check that Bats is executed with Bash >= 3.2 (#873)

### Fixed

Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载