summaryrefslogtreecommitdiff
path: root/tmux/.tmux/plugins/tpm/tests/helpers/tpm.sh
diff options
context:
space:
mode:
authorElizabeth <me@liz.coffee>2025-05-19 23:03:02 -0700
committerElizabeth <me@liz.coffee>2025-05-19 23:03:02 -0700
commit15b24ab9d782a8e5683f305ec8b1c31849a64246 (patch)
treebdb7c85f0d1f81e493c43360125ca61d6d26145c /tmux/.tmux/plugins/tpm/tests/helpers/tpm.sh
downloaddotfiles-15b24ab9d782a8e5683f305ec8b1c31849a64246.tar.gz
dotfiles-15b24ab9d782a8e5683f305ec8b1c31849a64246.zip
initial commit
Diffstat (limited to 'tmux/.tmux/plugins/tpm/tests/helpers/tpm.sh')
-rw-r--r--tmux/.tmux/plugins/tpm/tests/helpers/tpm.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tmux/.tmux/plugins/tpm/tests/helpers/tpm.sh b/tmux/.tmux/plugins/tpm/tests/helpers/tpm.sh
new file mode 100644
index 0000000..1594afb
--- /dev/null
+++ b/tmux/.tmux/plugins/tpm/tests/helpers/tpm.sh
@@ -0,0 +1,13 @@
+check_dir_exists_helper() {
+ [ -d "$1" ]
+}
+
+# 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 2>&1 |
+ grep "$expected_output" >/dev/null 2>&1 && # grep -q flag quits the script early
+ [ "${PIPESTATUS[0]}" -eq "$expected_exit_code" ]
+}