mirror of
https://github.com/tmux-plugins/tpm.git
synced 2025-09-14 00:46:56 +00:00
Switch to using tmux-test
framework
This commit is contained in:
18
tests/helpers/tpm.sh
Normal file
18
tests/helpers/tpm.sh
Normal file
@ -0,0 +1,18 @@
|
||||
check_dir_exists_helper() {
|
||||
local dir_path=$1
|
||||
if [ -d "$dir_path" ]; then
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# runs the scripts and asserts it has the correct output and exit code
|
||||
script_run_helper() {
|
||||
local script="$1"
|
||||
local expected_output="$2"
|
||||
local expected_exit_code="${3:-0}"
|
||||
"$script" |
|
||||
grep "$expected_output" >/dev/null 2>&1 && # grep -q flag quits the script early
|
||||
[ "${PIPESTATUS[0]}" -eq "$expected_exit_code" ]
|
||||
}
|
Reference in New Issue
Block a user