-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode_area_tests.cpp
More file actions
277 lines (175 loc) · 6.51 KB
/
Copy pathcode_area_tests.cpp
File metadata and controls
277 lines (175 loc) · 6.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
#include <cmath>
#include <string>
#include <vector>
namespace CODE_AREA_TESTS
{
// TEST: hover
// START ----------------------------------------------------------------------
namespace hover // <- ACTION 1: hover namespace
{
void function(size_t number, bool flag) // <- ACTION 2: function
{
if (flag)
{
number += 10; // <- ACTION 3: hover number
}
}
}
// RESULTS 1:
// - namespace name gets border
// - namespace and it's scope show highlight at line numbers
// - tooltip shows CODE_AREA_TESTS::hover
// RESULTS 2:
// - function name gets border
// - function and it's scope show highlight at line numbers
// - tooltip shows function signature
// RESULTS 3:
// - variable name and all references get highlighted
// - every line with a reference shows a highlight at the line number
// - no tooltip is shown
// END ------------------------------------------------------------------------
// TEST: Activating symbol
// START ----------------------------------------------------------------------
void some_function() // <- ACTION: click on function
{
}
// RESULTS:
// - function is activated
// - reference navigation at top shows "1 reference"
// END ------------------------------------------------------------------------
// TEST: Activating reference
// START ----------------------------------------------------------------------
void func() {}
void reference_test()
{
func(); // <- ACTION: click on function call
}
// RESULTS:
// - function is activated
// - definition location and reference location is active
// - reference navigation at top shows "2 references"
// END ------------------------------------------------------------------------
// TEST: Activating qualifier
// START ----------------------------------------------------------------------
namespace qualifier
{
void func() {}
}
void qualifier_test()
{
/* ACTION: Click on qualifier -> */ qualifier::func();
}
// RESULTS:
// - qualifier is activated
// - clicked qualifier location is not highlighted
// - reference navigation shows "1 reference"
// END ------------------------------------------------------------------------
// TEST: members have implicit reference locations at type definition
// START ----------------------------------------------------------------------
class TestType
{};
class Sample // <- ACTION 1: click class name
{
public:
TestType m_type;
};
Sample s;
// RESULT 1: shows list:
// Sample
// Sample::m_type
// ACTION 2: click on Sample::m_type
// RESULT 2: member has 2 references, one at class name
// END ------------------------------------------------------------------------
// TEST: clicking on overridden method activates it immediately
// START ----------------------------------------------------------------------
class Base
{
virtual void foo();
};
class Override
: public Base
{
void foo() override; // <- ACTION: click on foo()
};
// RESULT: Override::foo() is activated
// END ------------------------------------------------------------------------
// TEST: clicking on macro usage shows list of symbols referenced at location
// START ----------------------------------------------------------------------
#define POW(__number__, __power__) \
std::pow(__number__, __power__)
int a = POW(42, 2); // <- ACTION 1: click on POW
// RESULT 1: shows list:
// POW
// pow<int, int>
// std
// ACTION 2: click on POW in the list
// RESULT 2: POW is activated
// END ------------------------------------------------------------------------
// TEST: function tooltip - BROKEN
// START ----------------------------------------------------------------------
std::vector<std::string> very_long_function_name_with_three_parameters( // <- ACTION 1: hover function
const std::vector<std::string>& strings, size_t number, bool flag)
{
return strings;
}
// RESULT 1:
// - Tooltip shows signature as defined in code with qualifier:
// std::vector<std::string>
// CODE_AREA_TESTS::very_long_function_name_with_three_parameters(
// const std::vector<std::string>& strings,
// size_t number,
// bool flag
// )
// ACTION 2: hover all symbols in the tooltip
// RESULT 2: all types, qualifier and function is clickable
// ACTION 3: click on one of them
// RESULT 3: Clicked symbol is activated
// END ------------------------------------------------------------------------
// TEST: auto tooltip - BROKEN
// START ----------------------------------------------------------------------
void auto_function(const std::vector<std::string>& strings)
{
auto it = strings.begin(); // <- ACTION 1: hover auto
}
// RESULT 1: Tooltip shows underlying type
// END ------------------------------------------------------------------------
// TEST: typedef tooltip - BROKEN
// START ----------------------------------------------------------------------
typedef unsigned int uint;
uint b = 12; // <- ACTION 1: hover uint
// RESULT 1: Tooltip shows underlying type
// END ------------------------------------------------------------------------
// TEST: horizontal panning
// START ----------------------------------------------------------------------
void very_long_function_name_with_three_parameters_that_is_so_long_it_does_not_fit_on_the_screen(const std::vector<std::string>& strings, size_t number, bool flag);
// ACTION 1: Hold SHIFT and drag code left and right
// RESULT 1: It pans left and right
// ACTION 2: Switch to snippet/single mode and repeat
// RESULT 2: same thing
// END ------------------------------------------------------------------------
// TEST: copy & paste
// START ----------------------------------------------------------------------
void copy_function(
const std::vector<std::string>& strings,
size_t number,
bool flag)
{
for (auto str : strings)
{
number++;
}
}
// ^ ACTION: Select whole piece of code and paste it into a text editor
// RESULT: All code is pasted.
// END ------------------------------------------------------------------------
// TEST: copy file path
// START ----------------------------------------------------------------------
// ACTION: Open context menu and choose "Copy Full Path" and paste it to a text editor.
// RESULT: Full path to the file is pasted
// END ------------------------------------------------------------------------
// TEST: open containing folder
// START ----------------------------------------------------------------------
// ACTION: Open context menu and choose "Open Containing Folder".
// RESULT: The filesystem explorer is opened showing the "data" directory of this testsuite.
// END ------------------------------------------------------------------------
}