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 }