summaryrefslogtreecommitdiff
path: root/tests/link_detection.sh
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2019-09-15 17:49:03 +0200
committerBoris Faure <billiob@gmail.com>2019-09-15 20:39:41 +0200
commit02a418b290ad9501d9f843d7e7e05869dcb94293 (patch)
treefa87d9e8bc05de15044bfe8529d12cc5d64642e3 /tests/link_detection.sh
parent2c5bab7b8d5bdb3acb89f363d685b4b1e6ffd1d5 (diff)
termptyext: add tests on link detection
Diffstat (limited to 'tests/link_detection.sh')
-rwxr-xr-xtests/link_detection.sh227
1 files changed, 227 insertions, 0 deletions
diff --git a/tests/link_detection.sh b/tests/link_detection.sh
new file mode 100755
index 0000000..b67d882
--- /dev/null
+++ b/tests/link_detection.sh
@@ -0,0 +1,227 @@
1#!/bin/sh
2
3# char width: 7
4# char height: 15
5
6# clear screen
7printf '\033[2J'
8
9# set color
10printf '\033[46;31;3m'
11
12# move to 2; 0
13printf '\033[2;0H'
14
15printf 'Avast to go on account crack Jennys tea cup code of conduct grog https://terminolo.gy/ blossom hands scourge of the seven seas gangway pillage starboard. Admiral of the Black case shot barque red ensign Privateer cutlass Arr measured fer yer chains Gold Road league. Crack Jennys tea cup cog spirits keelhaul handsomely broadside carouser ho gabion barque. www.Enlightenment.org\r\n\r\n'
16
17printf 'Black jack six pounders flogging splice the main brace starboard yo-ho-ho Corsair plunder gally keelhaul. Landlubber or just lubber sloop jib lugsail foo.bar@qux.com clipper jury mast hornswaggle Blimey yard Pirate Round. Ye grapple parley brig brigantine spanker fluke warp league man-of-war.\r\n\r\n'
18
19printf 'Jolly Roger fluke me brig grapple furl tack rutters gally brigantine. Shiver me timbers yo-ho-ho black spot barque fore doubloon plunder run a shot ~/bin/terminology across the bow tack league. Brig lad keel keelhaul skysail cutlass rutters handsomely snow splice the main brace. \r\n\r\n'
20
21printf "Reef sails Gold Road dead men tell no tales aft gangway lad quarter draught case shot grapple. Stern lass jury mast yo-ho-ho maroon shrouds mizzen /usr/bin/terminology wench jolly boat Admiral of the Black. Maroon Chain Shot pirate wench pillage strike colors bowsprit bucko lee Davy Jones\' Locker. \r\n"
22
23
24##
25# URL (https://terminolo.gy/)
26##
27
28# mouse move
29printf '\033}tm;450;25\0'
30# no url detection just before url
31printf '\033}tln\0'
32
33# mouse move
34printf '\033}tm;458;25\0'
35# url detection on first character 'h'
36printf '\033}tlu;65;1;5;2;https://terminolo.gy/\0'
37
38# mouse move
39printf '\033}tm;495;25\0'
40# url detection on first character ':'
41printf '\033}tlu;65;1;5;2;https://terminolo.gy/\0'
42
43# mouse move
44printf '\033}tm;499;25\0'
45# url detection on first character '/'
46printf '\033}tlu;65;1;5;2;https://terminolo.gy/\0'
47
48# mouse move
49printf '\033}tm;510;25\0'
50# url detection on second character '/'
51printf '\033}tlu;65;1;5;2;https://terminolo.gy/\0'
52
53# mouse move
54printf '\033}tm;550;25\0'
55# url detection on 'n'
56printf '\033}tlu;65;1;5;2;https://terminolo.gy/\0'
57
58# mouse move
59printf '\033}tm;5;45\0'
60# url detection on start of second line
61printf '\033}tlu;65;1;5;2;https://terminolo.gy/\0'
62
63# mouse move
64printf '\033}tm;40;45\0'
65# url detection on last /
66printf '\033}tlu;65;1;5;2;https://terminolo.gy/\0'
67
68# mouse move
69printf '\033}tm;45;45\0'
70# TODO: buggy
71### no url detection on space after url
72##printf '\033}tln\0'
73
74
75##
76# Not a link (league.)
77##
78
79# mouse move
80printf '\033}tm;140;65\0'
81# no url detection on 'l'
82printf '\033}tln\0'
83
84# mouse move
85printf '\033}tm;180;65\0'
86# no url detection on '.'
87printf '\033}tln\0'
88
89
90
91##
92# URL (www.Enlightenment.org)
93##
94
95# mouse move
96printf '\033}tm;255;85\0'
97# no url detection on ' ' before url
98printf '\033}tln\0'
99
100# mouse move
101printf '\033}tm;265;85\0'
102# url detection on 'w'
103printf '\033}tlu;37;5;57;5;www.Enlightenment.org\0'
104
105# mouse move
106printf '\033}tm;395;85\0'
107# url detection on 'r'
108printf '\033}tlu;37;5;57;5;www.Enlightenment.org\0'
109
110# mouse move
111printf '\033}tm;410;85\0'
112# no url detection on empty space after url
113printf '\033}tln\0'
114
115
116
117##
118# Email (foo.bar@qux.com)
119##
120
121# mouse move
122printf '\033}tm;485;130\0'
123# TODO: buggy
124### no email detection on ' ' before email
125##printf '\033}tln\0'
126
127# mouse move
128printf '\033}tm;495;133\0'
129# email detection on 'f'
130printf '\033}tle;70;8;4;9;foo.bar@qux.com\0'
131
132# mouse move
133printf '\033}tm;540;130\0'
134# email detection on 'f'
135printf '\033}tle;70;8;4;9;foo.bar@qux.com\0'
136
137# mouse move
138printf '\033}tm;540;130\0'
139# email detection on '@'
140printf '\033}tle;70;8;4;9;foo.bar@qux.com\0'
141
142# mouse move
143printf '\033}tm;10;140\0'
144# email detection on '.'
145printf '\033}tle;70;8;4;9;foo.bar@qux.com\0'
146
147# mouse move
148printf '\033}tm;40;140\0'
149# TODO: buggy
150### no email detection on ' ' after email
151##printf '\033}tle;70;8;4;9;foo.bar@qux.com\0'
152
153
154
155##
156# File (~/bin/terminology)
157##
158
159# mouse move
160printf '\033}tm;480;200\0'
161# no file detection on ' ' before path
162printf '\033}tln\0'
163
164# mouse move
165printf '\033}tm;485;200\0'
166# file detection on '~'
167printf '\033}tlp;69;13;5;14;%s/bin/terminology\0' "$HOME"
168
169# mouse move
170printf '\033}tm;550;200\0'
171# file detection on 'm'
172printf '\033}tlp;69;13;5;14;%s/bin/terminology\0' "$HOME"
173
174# mouse move
175printf '\033}tm;5;215\0'
176# file detection on 'n'
177printf '\033}tlp;69;13;5;14;%s/bin/terminology\0' "$HOME"
178
179# mouse move
180printf '\033}tm;40;215\0'
181# file detection on 'n'
182printf '\033}tlp;69;13;5;14;%s/bin/terminology\0' "$HOME"
183
184# mouse move
185printf '\033}tm;48;215\0'
186# TODO: buggy
187### no file detection on ' ' after path
188##printf '\033}tln\0'
189
190
191
192##
193# File (/usr/bin/terminology)
194##
195
196# mouse move
197printf '\033}tm;466;280\0'
198# no file detection on ' ' before path
199printf '\033}tln\0'
200
201# mouse move
202printf '\033}tm;470;280\0'
203# file detection on '/'
204printf '\033}tlp;67;18;6;19;/usr/bin/terminology\0'
205
206# mouse move
207printf '\033}tm;550;280\0'
208# file detection on 'r'
209printf '\033}tlp;67;18;6;19;/usr/bin/terminology\0'
210
211# mouse move
212printf '\033}tm;5;295\0'
213# file detection on 'i'
214printf '\033}tlp;67;18;6;19;/usr/bin/terminology\0'
215
216# mouse move
217printf '\033}tm;40;295\0'
218# file detection on 'g'
219printf '\033}tlp;67;18;6;19;/usr/bin/terminology\0'
220
221# mouse move
222printf '\033}tm;58;295\0'
223# TODO: buggy
224### no file detection on ' ' after path
225##printf '\033}tln\0'
226
227