]> Sergey Matveev's repositories - bfs.git/commitdiff
tests: Check for expect_unbuffer too
authorTavian Barnes <tavianator@tavianator.com>
Fri, 6 Oct 2023 15:56:31 +0000 (11:56 -0400)
committerTavian Barnes <tavianator@tavianator.com>
Fri, 6 Oct 2023 15:59:57 +0000 (11:59 -0400)
That's where FreeBSD installs it.

tests/tests.sh

index 5297446d7ef02b1f644c6d73492a3d439229f74c..662efd94a441c008ab817da1376b8a770f1f63a9 100755 (executable)
@@ -488,11 +488,17 @@ function invoke_bfs() {
     fi
 }
 
+if command -v unbuffer &>/dev/null; then
+    UNBUFFER=unbuffer
+elif command -v expect_unbuffer &>/dev/null; then
+    UNBUFFER=expect_unbuffer
+fi
+
 function bfs_pty() {
-    command -v unbuffer &>/dev/null || skip
+    test -n "$UNBUFFER" || skip
 
     bfs_verbose "$@"
-    unbuffer bash -c 'stty cols 80 rows 24 && "$@"' bash "${BFS[@]}" "$@"
+    "$UNBUFFER" bash -c 'stty cols 80 rows 24 && "$@"' bash "${BFS[@]}" "$@"
     local status="$?"
 
     if ((status > 125)); then