From 3b3827a5339366f8571526dbbaf94315deec771c Mon Sep 17 00:00:00 2001 From: pvincent Date: Sat, 18 Jul 2026 14:52:10 +0400 Subject: [PATCH] ansi.test.bash --- lib/ansi.bash | 1 - test/ansi.test.bash | 8 ++++++++ test/stub/scenario.bash | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100755 test/ansi.test.bash diff --git a/lib/ansi.bash b/lib/ansi.bash index b28a3fa..a371d08 100644 --- a/lib/ansi.bash +++ b/lib/ansi.bash @@ -94,6 +94,5 @@ function style_block { for _ in $(seq 1 "${length}"); do builtin echo -n '═'; done builtin echo "╝" ) - style_ansi "${bottom}" && echo } diff --git a/test/ansi.test.bash b/test/ansi.test.bash new file mode 100755 index 0000000..d8b5eed --- /dev/null +++ b/test/ansi.test.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env miaou-bash + +. "$MIAOU_BASH_DIR/lib/ansi.bash" + +content=$(BG=RED FG=BLACK style_ansi "SUBSHELL TERM") +content=$(PADDING=2 BG=RED style_padding "$content") +detail=$(PADDING=1 style_padding "blabla") +PADDING=2 BG=RED FG=BLACK style_block "$content$detail" diff --git a/test/stub/scenario.bash b/test/stub/scenario.bash index 2de8111..5f485b2 100755 --- a/test/stub/scenario.bash +++ b/test/stub/scenario.bash @@ -9,8 +9,8 @@ readonly BASEDIR function do_subshell_term { # grep nope nope - echo "found=$(grep nope nope)" echo "found=$(command_not_found)" + echo "found=$(grep nope nope)" command_not_found }