summaryrefslogtreecommitdiffstats
path: root/tests/tests.sh
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-10-06 11:42:06 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-10-06 11:58:58 -0400
commit5e7b5eeb59f9f46ce916aaf968dd42570570580a (patch)
tree133c228e12ac8db13151b207a2bf927111bc9bb2 /tests/tests.sh
parent2d0cd364b63e26d7ede70cc1d6f85bea87850d84 (diff)
downloadbfs-5e7b5eeb59f9f46ce916aaf968dd42570570580a.tar.xz
tests: New bfs_pty wrapper for unbuffer
Diffstat (limited to 'tests/tests.sh')
-rwxr-xr-xtests/tests.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/tests.sh b/tests/tests.sh
index 61f17b4..5297446 100755
--- a/tests/tests.sh
+++ b/tests/tests.sh
@@ -488,6 +488,20 @@ function invoke_bfs() {
fi
}
+function bfs_pty() {
+ command -v unbuffer &>/dev/null || skip
+
+ bfs_verbose "$@"
+ unbuffer bash -c 'stty cols 80 rows 24 && "$@"' bash "${BFS[@]}" "$@"
+ local status="$?"
+
+ if ((status > 125)); then
+ exit "$status"
+ else
+ return "$status"
+ fi
+}
+
function check_exit() {
local expected="$1"
local actual="0"