summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-03-03 22:49:34 +0100
committerBoris Faure <billiob@gmail.com>2019-03-03 22:57:11 +0100
commitc462dce26dab48a1179ecf8c7f1c9703d84424c7 (patch)
tree24ce57715ce3c0f02a64383da50926488c0a78a0 /tests
parentc9b5c52a5d7bc74d1401498c7d5d56b08fb80a84 (diff)
tests: add some on mouse reporting in mode "all", utf8 reporting
Diffstat (limited to 'tests')
-rwxr-xr-xtests/mouse_reporting_mode_all_ext_utf8.sh191
-rw-r--r--tests/tests.results3
2 files changed, 193 insertions, 1 deletions
diff --git a/tests/mouse_reporting_mode_all_ext_utf8.sh b/tests/mouse_reporting_mode_all_ext_utf8.sh
new file mode 100755
index 0000000..fe4654c
--- /dev/null
+++ b/tests/mouse_reporting_mode_all_ext_utf8.sh
@@ -0,0 +1,191 @@
1#!/bin/sh
2
3# char width: 7
4# char height: 15
5
6# resize window
7#resize window to 180-chars width
8printf '\033[8;;180;t'
9# force render
10printf '\033}tr\0'
11sleep 0.2
12
13# fill space with E
14printf '\033#8'
15
16# set color
17printf '\033[46;31;3m'
18
19# positions used are;
20# - 200;130 -> 9;29
21# - 480;130 -> 9;69
22# - 1230;130 -> 9;176
23# indicate the positions to help testing
24printf '\033[9;29H#'
25printf '\033[9;69H#'
26printf '\033[9;95H@' # after that one, MOUSE_X10 is not working
27printf '\033[9;176H#'
28
29# set mouse mode - normal reported - utf8 reporting
30printf '\033[?1006l'
31printf '\033[?1015l'
32printf '\033[?1003h'
33printf '\033[?1005h'
34printf '\033[H'
35
36## LEFT CLICK
37# should print ^[[M =)^[[M@Q)^[[M@e)^[[M#e)
38# move cursor
39printf '\033[1H'
40# mouse down
41printf '\033}td;200;130;1;0;0\0'
42# mouse move
43printf '\033}tm;340;130;0\0'
44printf '\033}tm;480;130;0\0'
45# mouse up
46printf '\033}tu;480;130;1;0;0\0'
47# mouse move back ^[[M?Q)^[[M?=)
48printf '\033}tm;340;130;0\0'
49printf '\033}tm;200;130;0\0'
50
51# mouse click
52printf '\033}td;480;130;1;0;0\0'
53# mouse move -> ^[[M e)
54printf '\033}tm;657;130;0\0'
55# mouse move at x:94 -> ^[[M@^?)
56printf '\033}tm;664;130;0\0'
57# mouse move at x:95 -> ^[[M@€)
58printf '\033}tm;671;130;0\0'
59# mouse move at x:174 -> ^[[M@Đ)
60printf '\033}tm;1230;130;0\0'
61# mouse up at x:174: -> ^[[M#Đ)
62printf '\033}tu;1230;130;1;0;0\0'
63#not pressed
64# mouse click at x:95 -> ^[[M?€)
65printf '\033}tm;671;130;0\0'
66# mouse click at x:94 -> ^[[M?^?)
67printf '\033}tm;664;130;0\0'
68# mouse click at x:93 -> ^[[M?~)
69printf '\033}tm;657;130;0\0'
70# force render
71printf '\033}tr\0'
72sleep 0.2
73
74## RIGHT CLICK
75# should print ^[[M"=)^[[MBQ)^[[MBe)^[[M#e)
76# move cursor
77printf '\033[2H'
78# mouse down
79printf '\033}td;200;130;3;0;0\0'
80# mouse move
81printf '\033}tm;340;130;0\0'
82printf '\033}tm;480;130;0\0'
83# mouse up
84printf '\033}tu;480;130;3;0;0\0'
85# mouse move back ^[[M?Q)^[[M?=)
86printf '\033}tm;340;130;0\0'
87printf '\033}tm;200;130;0\0'
88# force render
89printf '\033}tr\0'
90sleep 0.2
91
92## MIDDLE CLICK
93# should print ^[[M!=)^[[MAe)^[[M#e)
94# move cursor
95printf '\033[3H'
96# mouse down
97printf '\033}td;200;130;2;0;0\0'
98# mouse move
99printf '\033}tm;480;130;0\0'
100# mouse up
101printf '\033}tu;480;130;2;0;0\0'
102# mouse move back ^[[M?Q)^[[M?=)
103printf '\033}tm;340;130;0\0'
104printf '\033}tm;200;130;0\0'
105# force render
106printf '\033}tr\0'
107sleep 0.2
108
109## WHEEL
110# prints ^[[M`=)^[[Ma=)^[[M`e)^[[Mae)
111# move cursor
112printf '\033[4H'
113# wheel up/down
114printf '\033}tw;200;130;1;1;0\0'
115printf '\033}tw;200;130;0;1;0\0'
116printf '\033}tw;480;130;1;1;0\0'
117printf '\033}tw;480;130;0;1;0\0'
118# force render
119printf '\033}tr\0'
120sleep 0.2
121
122
123##
124# Same with Alt
125##
126printf '\033[6HWith Alt:'
127
128## LEFT CLICK
129# should print ^[[M(=)^[[M@e^[[M+e)
130# move cursor
131printf '\033[7H'
132# mouse down
133printf '\033}td;200;130;1;1;0\0'
134# mouse move
135printf '\033}tm;480;130;1\0'
136# mouse up
137printf '\033}tu;480;130;1;1;0\0'
138# mouse move back ^[[M?Q)^[[M?=)
139printf '\033}tm;340;130;1\0'
140printf '\033}tm;200;130;1\0'
141# force render
142printf '\033}tr\0'
143sleep 0.2
144
145
146## RIGHT CLICK
147# should print ^[[M*=)^[[MBe)^[[M+e)
148# move cursor
149printf '\033[8H'
150# mouse down
151printf '\033}td;200;130;3;1;0\0'
152# mouse move
153printf '\033}tm;480;130;1\0'
154# mouse up
155printf '\033}tu;480;130;3;1;0\0'
156# mouse move back ^[[M?Q)^[[M?=)
157printf '\033}tm;340;130;1\0'
158printf '\033}tm;200;130;1\0'
159# force render
160printf '\033}tr\0'
161sleep 0.2
162
163
164## MIDDLE CLICK
165# should print ^[[M)=)^[[MAe^[[M+e
166# move cursor
167printf '\033[9H'
168# mouse down
169printf '\033}td;200;130;2;1;0\0'
170# mouse move
171printf '\033}tm;480;130;1\0'
172# mouse up
173printf '\033}tu;480;130;2;1;0\0'
174# mouse move back ^[[M?Q)^[[M?=)
175printf '\033}tm;340;130;1\0'
176printf '\033}tm;200;130;1\0'
177# force render
178printf '\033}tr\0'
179sleep 0.2
180
181## WHEEL
182# prints ^[[M`=)^[[M+e)
183# move cursor
184printf '\033[10H'
185# wheel up/down
186printf '\033}tw;200;130;1;1;1\0'
187printf '\033}tu;480;130;0;1;1\0'
188# force render
189printf '\033}tr\0'
190sleep 0.2
191printf '\033[14H'
diff --git a/tests/tests.results b/tests/tests.results
index 0c66ba2..d8b382f 100644
--- a/tests/tests.results
+++ b/tests/tests.results
@@ -103,7 +103,8 @@ selection_box_to_paragraph.sh 7b918d2af64eef1ecb39a0f45cf72f2d
103selection_invalidation_line_removed.sh 8d689636f976b044dfbf6af6b3333093 103selection_invalidation_line_removed.sh 8d689636f976b044dfbf6af6b3333093
104resize_window_no_content_change.sh 28d45fe49c686c8c98631cce8e4bd368 104resize_window_no_content_change.sh 28d45fe49c686c8c98631cce8e4bd368
105mouse_reporting_mode_x10_ext_none.sh b56ef7d0e2cc236e31ff2e149528833b 105mouse_reporting_mode_x10_ext_none.sh b56ef7d0e2cc236e31ff2e149528833b
106mouse_reporting_mode_x10_ext_utf8.sh c503d835cde7b0d147ae7a61e1b44fd1
107mouse_reporting_mode_normal_ext_none.sh 56cb28ca5427a0b0a97642ccdba5464d 106mouse_reporting_mode_normal_ext_none.sh 56cb28ca5427a0b0a97642ccdba5464d
107mouse_reporting_mode_x10_ext_utf8.sh c503d835cde7b0d147ae7a61e1b44fd1
108mouse_reporting_mode_normal_ext_utf8.sh 7acfea21b2fd997436d4fbee7610a9f9 108mouse_reporting_mode_normal_ext_utf8.sh 7acfea21b2fd997436d4fbee7610a9f9
109mouse_reporting_mode_mouse_move_pressed_ext_utf8.sh e5169c67f10ccc035089bf49ba9e1fa2 109mouse_reporting_mode_mouse_move_pressed_ext_utf8.sh e5169c67f10ccc035089bf49ba9e1fa2
110mouse_reporting_mode_all_ext_utf8.sh 2d828e122ff45b29fa99094208164f27