From b477d6cc20b9e33ce33acf06bd2cf2458b5e9948 Mon Sep 17 00:00:00 2001 From: Boris Faure Date: Wed, 27 Feb 2019 20:05:23 +0100 Subject: [PATCH] tests: add one on selection invalidation when line got removed --- tests/selection_invalidation_line_removed.sh | 49 ++++++++++++++++++++ tests/tests.results | 1 + 2 files changed, 50 insertions(+) create mode 100755 tests/selection_invalidation_line_removed.sh diff --git a/tests/selection_invalidation_line_removed.sh b/tests/selection_invalidation_line_removed.sh new file mode 100755 index 00000000..d83d78cc --- /dev/null +++ b/tests/selection_invalidation_line_removed.sh @@ -0,0 +1,49 @@ +#!/bin/sh + +# char width: 7 +# char height: 15 + +# clear screen +printf '\033[2J' + +# set color +printf '\033[46;31;3m' + +#move to 2,0 +printf '\033[2H' + +# 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" "$TEXT" "$TEXT" "$TEXT" +# force render +printf '\033}tr\0' + +# mouse down to start selection +printf '\033}td;395;148;1;4;0\0' +# mouse move +printf '\033}tm;175;150;4\0' +# mouse up +printf '\033}tu;175;150;1;4;0\0' +# force render +printf '\033}tr\0' +# selection is +printf '\033}tsevil men. Blessed is he who, in t\0' + + +# move +printf '\033[10H' +# force render +printf '\033}tr\0' +# selection is +printf '\033}tsevil men. Blessed is he who, in t\0' + +# remove line +printf '\033[2K' + +# force render +printf '\033}tr\0' + +# no more selection +printf '\033}tn\0' diff --git a/tests/tests.results b/tests/tests.results index 57574572..b747e2c2 100644 --- a/tests/tests.results +++ b/tests/tests.results @@ -100,3 +100,4 @@ selection_to_paragraph.sh 7b918d2af64eef1ecb39a0f45cf72f2d selection_box_to_position.sh 0174fb1d413f19f32e68e31439335d97 selection_box_to_word.sh 0174fb1d413f19f32e68e31439335d97 selection_box_to_paragraph.sh 7b918d2af64eef1ecb39a0f45cf72f2d +selection_invalidation_line_removed.sh 8d689636f976b044dfbf6af6b3333093