From 5e7b5eeb59f9f46ce916aaf968dd42570570580a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 6 Oct 2023 11:42:06 -0400 Subject: tests: New bfs_pty wrapper for unbuffer --- tests/tests.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/tests.sh') 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" -- cgit v1.2.3