tests: have tests on selection in history

This commit is contained in:
Boris Faure 2019-02-23 17:52:04 +01:00
parent 2f0bff67d5
commit b700a8a322
1 changed files with 72 additions and 8 deletions

View File

@ -17,6 +17,21 @@ TEXT="The path of the righteous man is beset on all sides by the iniquities of t
# display text
printf "%s\r\n%s\r\n%s" "$TEXT" "$TEXT" "$TEXT"
# force render
printf '\033}tr\0'
## full paragraph
printf '\033}td;2;50;1;0;0\0'
printf '\033}tu;2;50;1;0;0\0'
printf '\033}td;2;50;1;0;1\0'
printf '\033}tu;2;50;1;0;1\0'
printf '\033}td;2;50;1;0;2\0'
printf '\033}tu;2;50;1;0;2\0'
# force render
printf '\033}tr\0'
# remove selection
printf '\033}td;0;0;1;0;0\0\033}tu;0;0;1;0;0\0'
printf '\033}tr\0\033}tn\0'
# mouse down to start selection
@ -32,25 +47,74 @@ printf '\033}tsthe name of charity\0'
# scroll 30 lines
for L in $(seq 30); do
printf '%s\r\n' "$L"
printf '\r\n%s' "$L"
done
# force render
printf '\033}tr\0'
## simple selection
printf '\033}td;0;14;1;0;0\0'
printf '\033}tm;8;14\0'
printf '\033}tm;7;14\0'
printf '\033}tu;7;14;1;0;0\0'
# force render
printf '\033}tr\0'
# selection is '7'
printf '\033}ts7\0'
# remove selection
printf '\033}td;0;0;1;0;0\0\033}tu;0;0;1;0;0\0'
printf '\033}tr\0\033}tn\0'
# one wheel up
printf '\033}tw;0;0;1;1;0\0'
## simple selection
printf '\033}td;0;14;1;0;0\0'
printf '\033}tm;8;14\0'
printf '\033}tm;7;14\0'
printf '\033}tu;7;14;1;0;0\0'
# force render
printf '\033}tr\0'
# selection is '3'
printf '\033}ts3\0'
# remove selection
printf '\033}td;0;0;1;0;0\0\033}tu;0;0;1;0;0\0'
printf '\033}tr\0\033}tn\0'
# mouse wheel up
for _ in $(seq 6); do
for _ in $(seq 5); do
printf '\033}tw;0;0;1;1;0\0'
done
# force render
printf '\033}tr\0'
## normal selection
# mouse down to start selection
printf '\033}td;35;118;1;0;0\0'
# mouse move
printf '\033}tm;125;135;0\0'
# mouse up
printf '\033}tu;125;135;1;0;0\0'
# force render
printf '\033}tr\0'
# selection is
printf "\033}tsother\'s keeper and the finder of lost children. And I will strike down upon thee with great ve\0"
# remove selection
printf '\033}td;0;0;1;0;0\0\033}tu;0;0;1;0;0\0'
printf '\033}tr\0\033}tn\0'
## double click: word selection
printf '\033}td;230;135;1;0;0\0'
printf '\033}tu;230;135;1;0;0\0'
printf '\033}td;230;135;1;0;1\0'
printf '\033}tu;230;135;1;0;1\0'
printf '\033}td;230;134;1;0;0\0'
printf '\033}tu;230;134;1;0;0\0'
printf '\033}td;230;134;1;0;1\0'
printf '\033}tu;230;134;1;0;1\0'
# force render
printf '\033}tr\0'
@ -59,7 +123,7 @@ printf '\033}tr\0'
printf '\033}tsfurious\0'
# remove selection
printf '\033}td;0;0;1;0;0\0\033}tu;0;0;1;0;0\0'
printf '\033}tc;0;0\0\033}tc;1;0\0'
printf '\033}tr\0\033}tn\0'
## triple click: full paragraph selection
@ -75,4 +139,4 @@ printf '\033}tr\0'
printf '\033}ts%s\0' "$TEXT"
# remove selection
printf '\033}td;0;0;1;0;0\0\033}tu;0;0;1;0;0\0'
printf '\033}tc;0;0\0\033}tc;1;0\0'
printf '\033}tr\0\033}tn\0'