From 543b35b839f7485093b48f6ee09425b8d963a6ea Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Fri, 22 Oct 2021 16:13:54 -0400 Subject: [PATCH] Add two tests for cursor controls at last column MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From https://invent.kde.org/utilities/konsole/-/merge_requests/510 Luis Javier Merino MorĂ¡n --- tests/features/testdwlwrap.sh | 32 ++++++++++++++++++++++++++++++++ tests/features/testwrap.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 tests/features/testdwlwrap.sh create mode 100644 tests/features/testwrap.sh diff --git a/tests/features/testdwlwrap.sh b/tests/features/testdwlwrap.sh new file mode 100644 index 00000000..62aeff79 --- /dev/null +++ b/tests/features/testdwlwrap.sh @@ -0,0 +1,32 @@ +do_tests() { + tput cup 0 0; printf "$@" + + for i in {0..16}; do tput cup $i 0; printf "\e#6"; done + + tput cup 0 $((COLUMNS/2-1)); printf "AB" + tput cup 3 $((COLUMNS/2-1)); printf "A\bB" + tput cup 6 $((COLUMNS/2-1)); printf A; tput cud 1; printf B + tput cup 9 $((COLUMNS/2-1)); printf A; tput cuu 1; printf B + tput cup 12 $((COLUMNS/2-1)); printf A; tput cub 1; printf B + tput cup 15 $((COLUMNS/2-1)); printf A; tput cuf 1; printf B + + tput cup 18 1; echo -n -- "-- Press RETURN to run next test --" + read + #sleep 5 +} + +clear; tput smam +do_tests "No Reverse Wrap - AutoWrap Mode" + +clear; tput rmam +do_tests "No Reverse Wrap - No AutoWrap Mode" + + +clear; tput smam; printf "\e[?45h" +do_tests "Reverse Wrap - AutoWrap Mode" + +clear; tput rmam; printf "\e[?45h" +do_tests "Reverse Wrap - No AutoWrap Mode" + + +clear; tput smam; printf "\e[?45l" diff --git a/tests/features/testwrap.sh b/tests/features/testwrap.sh new file mode 100644 index 00000000..58c6169d --- /dev/null +++ b/tests/features/testwrap.sh @@ -0,0 +1,30 @@ +do_tests() { + tput cup 0 0; printf "$@" + + tput cup 0 $((COLUMNS-1)); printf "AB" + tput cup 3 $((COLUMNS-1)); printf "A\bB" + tput cup 6 $((COLUMNS-1)); printf A; tput cud 1; printf B + tput cup 9 $((COLUMNS-1)); printf A; tput cuu 1; printf B + tput cup 12 $((COLUMNS-1)); printf A; tput cub 1; printf B + tput cup 15 $((COLUMNS-1)); printf A; tput cuf 1; printf B + + tput cup 18 1; echo -n -- "-- Press RETURN to run next test --" + read + #sleep 5 +} + +clear; tput smam +do_tests "No Reverse Wrap - AutoWrap Mode" + +clear; tput rmam +do_tests "No Reverse Wrap - No AutoWrap Mode" + + +clear; tput smam; printf "\e[?45h" +do_tests "Reverse Wrap - AutoWrap Mode" + +clear; tput rmam; printf "\e[?45h" +do_tests "Reverse Wrap - No AutoWrap Mode" + + +clear; tput smam; printf "\e[?45l"