bash-it/test
buhl c9a7837b44 Squashed 'vendor/github.com/rcaloras/bash-preexec/' content from commit 7884535
git-subtree-dir: vendor/github.com/rcaloras/bash-preexec
git-subtree-split: 7884535ed423ac27d3b6b473c61b1fe41905aca1
2021-01-23 18:28:43 +01:00
..
README.md Squashed 'vendor/github.com/rcaloras/bash-preexec/' content from commit 7884535 2021-01-23 18:28:43 +01:00
bash-preexec.bats Squashed 'vendor/github.com/rcaloras/bash-preexec/' content from commit 7884535 2021-01-23 18:28:43 +01:00
include-test.bats Squashed 'vendor/github.com/rcaloras/bash-preexec/' content from commit 7884535 2021-01-23 18:28:43 +01:00

README.md

Testing bash-preexec

Note on test conditions

When writing test conditions, use [ ... ] instead of [[ ... ]] since the former are supported by Bats on Bash versions before 4.1. In particular, macOS uses Bash 3.2, and [[ ... ]] tests always pass on macOS.

In some cases, you may want to use a feature unique to [[ ... ]] such as pattern matching ([[ $name = a* ]]) or regular expressions ([[ $(date) =~ ^Fri\ ...\ 13 ]]). In those cases, use the following pattern to replace “bare” [[ ... ]].

[[ ... ]] || return 1

References: