From 422ef9f67ec5f1cbd274973ba1edd582ffa49c69 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Tue, 5 May 2020 20:50:28 +0200 Subject: [PATCH] tests: add box selection that scrolls up --- tests/selection_box_scrolls_up.sh | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 tests/selection_box_scrolls_up.sh diff --git a/tests/selection_box_scrolls_up.sh b/tests/selection_box_scrolls_up.sh new file mode 100755 index 00000000..221bd4dc --- /dev/null +++ b/tests/selection_box_scrolls_up.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# char width: 7 +# char height: 15 + +# clear screen +printf '\033[2J' + +# set color +printf '\033[46;31;3m' + +#move to 0,0 +printf '\033[H' + +# set text +TEXT="The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee." + +# display text +printf "%s\r\n%s\r\n%s\r\n" "1>$TEXT" "2>$TEXT" "3>$TEXT" +printf "%s\r\n%s\r\n%s\r\n" "4>$TEXT" "5>$TEXT" "6>$TEXT" + +# mouse down to start selection +printf '\033}td;100;35;1;4;0\0' +# mouse move +printf '\033}tm;70;35;4\0' +# make scroll up +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +printf '\033}tm;35;3;4\0' +# mouse up +printf '\033}tu;35;3;1;4;0\0' +# force render +printf '\033}tr\0' +# selection is active +printf '\033}tn!\0'