@zzzen/pyright-internal 1.2.0-dev.20240428 → 1.2.0-dev.20240512

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/analyzer/analyzerFileInfo.js +3 -2
  2. package/dist/analyzer/analyzerFileInfo.js.map +1 -1
  3. package/dist/analyzer/binder.js +6 -0
  4. package/dist/analyzer/binder.js.map +1 -1
  5. package/dist/analyzer/checker.js +62 -35
  6. package/dist/analyzer/checker.js.map +1 -1
  7. package/dist/analyzer/declaration.d.ts +1 -0
  8. package/dist/analyzer/declaration.js.map +1 -1
  9. package/dist/analyzer/operations.js +3 -2
  10. package/dist/analyzer/operations.js.map +1 -1
  11. package/dist/analyzer/patternMatching.js +20 -14
  12. package/dist/analyzer/patternMatching.js.map +1 -1
  13. package/dist/analyzer/scope.d.ts +4 -0
  14. package/dist/analyzer/scope.js +9 -2
  15. package/dist/analyzer/scope.js.map +1 -1
  16. package/dist/analyzer/sourceFile.js +13 -5
  17. package/dist/analyzer/sourceFile.js.map +1 -1
  18. package/dist/analyzer/typeEvaluator.js +56 -17
  19. package/dist/analyzer/typeEvaluator.js.map +1 -1
  20. package/dist/analyzer/typeGuards.d.ts +1 -1
  21. package/dist/analyzer/typeGuards.js +38 -19
  22. package/dist/analyzer/typeGuards.js.map +1 -1
  23. package/dist/analyzer/typeUtils.js +1 -5
  24. package/dist/analyzer/typeUtils.js.map +1 -1
  25. package/dist/analyzer/types.js +8 -0
  26. package/dist/analyzer/types.js.map +1 -1
  27. package/dist/common/envVarUtils.js +1 -2
  28. package/dist/common/envVarUtils.js.map +1 -1
  29. package/dist/common/pythonVersion.d.ts +1 -0
  30. package/dist/common/pythonVersion.js +2 -1
  31. package/dist/common/pythonVersion.js.map +1 -1
  32. package/dist/languageServerBase.d.ts +3 -2
  33. package/dist/languageServerBase.js +13 -35
  34. package/dist/languageServerBase.js.map +1 -1
  35. package/dist/languageService/callHierarchyProvider.js +1 -1
  36. package/dist/languageService/callHierarchyProvider.js.map +1 -1
  37. package/dist/languageService/dynamicFeature.d.ts +18 -0
  38. package/dist/languageService/dynamicFeature.js +54 -0
  39. package/dist/languageService/dynamicFeature.js.map +1 -0
  40. package/dist/languageService/fileWatcherDynamicFeature.d.ts +12 -0
  41. package/dist/languageService/fileWatcherDynamicFeature.js +49 -0
  42. package/dist/languageService/fileWatcherDynamicFeature.js.map +1 -0
  43. package/dist/localization/package.nls.cs.json +28 -26
  44. package/dist/localization/package.nls.de.json +28 -26
  45. package/dist/localization/package.nls.en-us.json +2 -2
  46. package/dist/localization/package.nls.es.json +27 -25
  47. package/dist/localization/package.nls.fr.json +28 -26
  48. package/dist/localization/package.nls.it.json +28 -26
  49. package/dist/localization/package.nls.ja.json +28 -26
  50. package/dist/localization/package.nls.ko.json +28 -26
  51. package/dist/localization/package.nls.pl.json +27 -25
  52. package/dist/localization/package.nls.pt-br.json +28 -26
  53. package/dist/localization/package.nls.qps-ploc.json +25 -23
  54. package/dist/localization/package.nls.ru.json +28 -26
  55. package/dist/localization/package.nls.tr.json +28 -26
  56. package/dist/localization/package.nls.zh-cn.json +28 -26
  57. package/dist/localization/package.nls.zh-tw.json +28 -26
  58. package/dist/parser/tokenizer.js +7 -1
  59. package/dist/parser/tokenizer.js.map +1 -1
  60. package/dist/tests/envVarUtils.test.js +20 -0
  61. package/dist/tests/envVarUtils.test.js.map +1 -1
  62. package/dist/tests/parser.test.js +7 -2
  63. package/dist/tests/parser.test.js.map +1 -1
  64. package/dist/tests/typeEvaluator1.test.js +59 -479
  65. package/dist/tests/typeEvaluator1.test.js.map +1 -1
  66. package/dist/tests/typeEvaluator2.test.js +4 -486
  67. package/dist/tests/typeEvaluator2.test.js.map +1 -1
  68. package/dist/tests/typeEvaluator3.test.js +0 -604
  69. package/dist/tests/typeEvaluator3.test.js.map +1 -1
  70. package/dist/tests/typeEvaluator4.test.js +1 -423
  71. package/dist/tests/typeEvaluator4.test.js.map +1 -1
  72. package/dist/tests/typeEvaluator6.test.d.ts +1 -0
  73. package/dist/tests/typeEvaluator6.test.js +712 -0
  74. package/dist/tests/typeEvaluator6.test.js.map +1 -0
  75. package/dist/tests/typeEvaluator7.test.d.ts +1 -0
  76. package/dist/tests/typeEvaluator7.test.js +677 -0
  77. package/dist/tests/typeEvaluator7.test.js.map +1 -0
  78. package/dist/tests/typeEvaluator8.test.d.ts +1 -0
  79. package/dist/tests/typeEvaluator8.test.js +660 -0
  80. package/dist/tests/typeEvaluator8.test.js.map +1 -0
  81. package/package.json +1 -1
@@ -0,0 +1,677 @@
1
+ "use strict";
2
+ /*
3
+ * typeEvaluator7.test.ts
4
+ * Copyright (c) Microsoft Corporation.
5
+ * Licensed under the MIT license.
6
+ * Author: Eric Traut
7
+ *
8
+ * Unit tests for pyright type evaluator. Tests are split
9
+ * arbitrarily among multiple files so they can run in parallel.
10
+ */
11
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ var desc = Object.getOwnPropertyDescriptor(m, k);
14
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
15
+ desc = { enumerable: true, get: function() { return m[k]; } };
16
+ }
17
+ Object.defineProperty(o, k2, desc);
18
+ }) : (function(o, m, k, k2) {
19
+ if (k2 === undefined) k2 = k;
20
+ o[k2] = m[k];
21
+ }));
22
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
23
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
24
+ }) : function(o, v) {
25
+ o["default"] = v;
26
+ });
27
+ var __importStar = (this && this.__importStar) || function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ const configOptions_1 = require("../common/configOptions");
36
+ const pythonVersion_1 = require("../common/pythonVersion");
37
+ const uri_1 = require("../common/uri/uri");
38
+ const TestUtils = __importStar(require("./testUtils"));
39
+ test('GenericType1', () => {
40
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType1.py']);
41
+ TestUtils.validateResults(analysisResults, 5);
42
+ });
43
+ test('GenericType2', () => {
44
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType2.py']);
45
+ TestUtils.validateResults(analysisResults, 0);
46
+ });
47
+ test('GenericType3', () => {
48
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType3.py']);
49
+ TestUtils.validateResults(analysisResults, 2);
50
+ });
51
+ test('GenericType4', () => {
52
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType4.py']);
53
+ TestUtils.validateResults(analysisResults, 1);
54
+ });
55
+ test('GenericType5', () => {
56
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType5.py']);
57
+ TestUtils.validateResults(analysisResults, 1);
58
+ });
59
+ test('GenericType6', () => {
60
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType6.py']);
61
+ TestUtils.validateResults(analysisResults, 1);
62
+ });
63
+ test('GenericType7', () => {
64
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType7.py']);
65
+ TestUtils.validateResults(analysisResults, 2);
66
+ });
67
+ test('GenericType8', () => {
68
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType8.py']);
69
+ TestUtils.validateResults(analysisResults, 1);
70
+ });
71
+ test('GenericType9', () => {
72
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType9.py']);
73
+ TestUtils.validateResults(analysisResults, 2);
74
+ });
75
+ test('GenericType10', () => {
76
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType10.py']);
77
+ TestUtils.validateResults(analysisResults, 0);
78
+ });
79
+ test('GenericType11', () => {
80
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType11.py']);
81
+ TestUtils.validateResults(analysisResults, 0);
82
+ });
83
+ test('GenericType12', () => {
84
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType12.py']);
85
+ TestUtils.validateResults(analysisResults, 0);
86
+ });
87
+ test('GenericType13', () => {
88
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType13.py']);
89
+ TestUtils.validateResults(analysisResults, 0);
90
+ });
91
+ test('GenericType14', () => {
92
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType14.py']);
93
+ TestUtils.validateResults(analysisResults, 0);
94
+ });
95
+ test('GenericType15', () => {
96
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType15.py']);
97
+ TestUtils.validateResults(analysisResults, 0);
98
+ });
99
+ test('GenericType16', () => {
100
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType16.py']);
101
+ TestUtils.validateResults(analysisResults, 0);
102
+ });
103
+ test('GenericType17', () => {
104
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType17.py']);
105
+ TestUtils.validateResults(analysisResults, 0);
106
+ });
107
+ test('GenericType18', () => {
108
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType18.py']);
109
+ TestUtils.validateResults(analysisResults, 1);
110
+ });
111
+ test('GenericType19', () => {
112
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType19.py']);
113
+ TestUtils.validateResults(analysisResults, 0);
114
+ });
115
+ test('GenericType20', () => {
116
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType20.py']);
117
+ TestUtils.validateResults(analysisResults, 1);
118
+ });
119
+ test('GenericType21', () => {
120
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType21.py']);
121
+ TestUtils.validateResults(analysisResults, 0);
122
+ });
123
+ test('GenericType22', () => {
124
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType22.py']);
125
+ TestUtils.validateResults(analysisResults, 1);
126
+ });
127
+ test('GenericType23', () => {
128
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType23.py']);
129
+ TestUtils.validateResults(analysisResults, 0);
130
+ });
131
+ test('GenericType24', () => {
132
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType24.py']);
133
+ TestUtils.validateResults(analysisResults, 0);
134
+ });
135
+ test('GenericType25', () => {
136
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType25.py']);
137
+ TestUtils.validateResults(analysisResults, 1);
138
+ });
139
+ test('GenericType26', () => {
140
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType26.py']);
141
+ TestUtils.validateResults(analysisResults, 2);
142
+ });
143
+ test('GenericType27', () => {
144
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType27.py']);
145
+ TestUtils.validateResults(analysisResults, 0);
146
+ });
147
+ test('GenericType28', () => {
148
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType28.py']);
149
+ TestUtils.validateResults(analysisResults, 18);
150
+ });
151
+ test('GenericType29', () => {
152
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType29.py']);
153
+ TestUtils.validateResults(analysisResults, 0);
154
+ });
155
+ test('GenericType30', () => {
156
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType30.py']);
157
+ TestUtils.validateResults(analysisResults, 0);
158
+ });
159
+ test('GenericType31', () => {
160
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType31.py']);
161
+ TestUtils.validateResults(analysisResults, 2);
162
+ });
163
+ test('GenericType32', () => {
164
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType32.py']);
165
+ TestUtils.validateResults(analysisResults, 0);
166
+ });
167
+ test('GenericType33', () => {
168
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType33.py']);
169
+ TestUtils.validateResults(analysisResults, 1);
170
+ });
171
+ test('GenericType34', () => {
172
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType34.py']);
173
+ TestUtils.validateResults(analysisResults, 0);
174
+ });
175
+ test('GenericType35', () => {
176
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType35.py']);
177
+ TestUtils.validateResults(analysisResults, 1);
178
+ });
179
+ test('GenericType36', () => {
180
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType36.py']);
181
+ TestUtils.validateResults(analysisResults, 0);
182
+ });
183
+ test('GenericType37', () => {
184
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType37.py']);
185
+ TestUtils.validateResults(analysisResults, 0);
186
+ });
187
+ test('GenericType38', () => {
188
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType38.py']);
189
+ TestUtils.validateResults(analysisResults, 0);
190
+ });
191
+ test('GenericType39', () => {
192
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType39.py']);
193
+ TestUtils.validateResults(analysisResults, 0);
194
+ });
195
+ test('GenericType40', () => {
196
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType40.py']);
197
+ TestUtils.validateResults(analysisResults, 0);
198
+ });
199
+ test('GenericType41', () => {
200
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType41.py']);
201
+ TestUtils.validateResults(analysisResults, 0);
202
+ });
203
+ test('GenericType42', () => {
204
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType42.py']);
205
+ TestUtils.validateResults(analysisResults, 0);
206
+ });
207
+ test('GenericType43', () => {
208
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType43.py']);
209
+ TestUtils.validateResults(analysisResults, 0);
210
+ });
211
+ test('GenericType44', () => {
212
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType44.py']);
213
+ TestUtils.validateResults(analysisResults, 0);
214
+ });
215
+ test('GenericType45', () => {
216
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['genericType45.py']);
217
+ TestUtils.validateResults(analysisResults, 6);
218
+ });
219
+ test('Protocol1', () => {
220
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol1.py']);
221
+ TestUtils.validateResults(analysisResults, 8);
222
+ });
223
+ test('Protocol2', () => {
224
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol2.py']);
225
+ TestUtils.validateResults(analysisResults, 0);
226
+ });
227
+ test('Protocol3', () => {
228
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol3.py']);
229
+ TestUtils.validateResults(analysisResults, 12);
230
+ });
231
+ test('Protocol4', () => {
232
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol4.py']);
233
+ TestUtils.validateResults(analysisResults, 4);
234
+ });
235
+ test('Protocol5', () => {
236
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol5.py']);
237
+ TestUtils.validateResults(analysisResults, 0);
238
+ });
239
+ test('Protocol6', () => {
240
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol6.py']);
241
+ TestUtils.validateResults(analysisResults, 4);
242
+ });
243
+ test('Protocol7', () => {
244
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol7.py']);
245
+ TestUtils.validateResults(analysisResults, 1);
246
+ });
247
+ test('Protocol8', () => {
248
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol8.py']);
249
+ TestUtils.validateResults(analysisResults, 1);
250
+ });
251
+ test('Protocol9', () => {
252
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol9.py']);
253
+ TestUtils.validateResults(analysisResults, 0);
254
+ });
255
+ test('Protocol10', () => {
256
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol10.py']);
257
+ TestUtils.validateResults(analysisResults, 0);
258
+ });
259
+ test('Protocol11', () => {
260
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol11.py']);
261
+ TestUtils.validateResults(analysisResults, 0);
262
+ });
263
+ test('Protocol12', () => {
264
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol12.py']);
265
+ TestUtils.validateResults(analysisResults, 1);
266
+ });
267
+ test('Protocol13', () => {
268
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol13.py']);
269
+ TestUtils.validateResults(analysisResults, 0);
270
+ });
271
+ test('Protocol14', () => {
272
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol14.py']);
273
+ TestUtils.validateResults(analysisResults, 0);
274
+ });
275
+ test('Protocol15', () => {
276
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol15.py']);
277
+ TestUtils.validateResults(analysisResults, 0);
278
+ });
279
+ test('Protocol16', () => {
280
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol16.py']);
281
+ TestUtils.validateResults(analysisResults, 1);
282
+ });
283
+ test('Protocol17', () => {
284
+ const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
285
+ configOptions.diagnosticRuleSet.reportInvalidTypeVarUse = 'error';
286
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol17.py']);
287
+ TestUtils.validateResults(analysisResults, 7);
288
+ });
289
+ test('Protocol18', () => {
290
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol18.py']);
291
+ TestUtils.validateResults(analysisResults, 2);
292
+ });
293
+ test('Protocol19', () => {
294
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol19.py']);
295
+ TestUtils.validateResults(analysisResults, 2);
296
+ });
297
+ test('Protocol20', () => {
298
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol20.py']);
299
+ TestUtils.validateResults(analysisResults, 0);
300
+ });
301
+ test('Protocol21', () => {
302
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol21.py']);
303
+ TestUtils.validateResults(analysisResults, 1);
304
+ });
305
+ test('Protocol22', () => {
306
+ const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
307
+ configOptions.diagnosticRuleSet.reportInvalidTypeVarUse = 'error';
308
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol22.py']);
309
+ TestUtils.validateResults(analysisResults, 0);
310
+ });
311
+ test('Protocol23', () => {
312
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol23.py']);
313
+ TestUtils.validateResults(analysisResults, 2);
314
+ });
315
+ test('Protocol24', () => {
316
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol24.py']);
317
+ TestUtils.validateResults(analysisResults, 6);
318
+ });
319
+ test('Protocol25', () => {
320
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol25.py']);
321
+ TestUtils.validateResults(analysisResults, 1);
322
+ });
323
+ test('Protocol26', () => {
324
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol26.py']);
325
+ TestUtils.validateResults(analysisResults, 0);
326
+ });
327
+ test('Protocol28', () => {
328
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol28.py']);
329
+ TestUtils.validateResults(analysisResults, 0);
330
+ });
331
+ test('Protocol29', () => {
332
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol29.py']);
333
+ TestUtils.validateResults(analysisResults, 0);
334
+ });
335
+ test('Protocol30', () => {
336
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol30.py']);
337
+ TestUtils.validateResults(analysisResults, 2);
338
+ });
339
+ test('Protocol31', () => {
340
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol31.py']);
341
+ TestUtils.validateResults(analysisResults, 0);
342
+ });
343
+ test('Protocol32', () => {
344
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol32.py']);
345
+ TestUtils.validateResults(analysisResults, 2);
346
+ });
347
+ test('Protocol33', () => {
348
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol33.py']);
349
+ TestUtils.validateResults(analysisResults, 0);
350
+ });
351
+ test('Protocol34', () => {
352
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol34.py']);
353
+ TestUtils.validateResults(analysisResults, 1);
354
+ });
355
+ test('Protocol35', () => {
356
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol35.py']);
357
+ TestUtils.validateResults(analysisResults, 1);
358
+ });
359
+ test('Protocol36', () => {
360
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol36.py']);
361
+ TestUtils.validateResults(analysisResults, 0);
362
+ });
363
+ test('Protocol37', () => {
364
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol37.py']);
365
+ TestUtils.validateResults(analysisResults, 0);
366
+ });
367
+ test('Protocol38', () => {
368
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol38.py']);
369
+ TestUtils.validateResults(analysisResults, 0);
370
+ });
371
+ test('Protocol39', () => {
372
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol39.py']);
373
+ TestUtils.validateResults(analysisResults, 0);
374
+ });
375
+ test('Protocol40', () => {
376
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol40.py']);
377
+ TestUtils.validateResults(analysisResults, 0);
378
+ });
379
+ test('Protocol41', () => {
380
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol41.py']);
381
+ TestUtils.validateResults(analysisResults, 0);
382
+ });
383
+ test('Protocol42', () => {
384
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol42.py']);
385
+ TestUtils.validateResults(analysisResults, 0);
386
+ });
387
+ test('Protocol43', () => {
388
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol43.py']);
389
+ TestUtils.validateResults(analysisResults, 0);
390
+ });
391
+ test('Protocol44', () => {
392
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol44.py']);
393
+ TestUtils.validateResults(analysisResults, 0);
394
+ });
395
+ test('Protocol45', () => {
396
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol45.py']);
397
+ TestUtils.validateResults(analysisResults, 0);
398
+ });
399
+ test('Protocol46', () => {
400
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol46.py']);
401
+ TestUtils.validateResults(analysisResults, 0);
402
+ });
403
+ test('Protocol47', () => {
404
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol47.py']);
405
+ TestUtils.validateResults(analysisResults, 0);
406
+ });
407
+ test('Protocol48', () => {
408
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol48.py']);
409
+ TestUtils.validateResults(analysisResults, 0);
410
+ });
411
+ test('Protocol49', () => {
412
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocol49.py']);
413
+ TestUtils.validateResults(analysisResults, 0);
414
+ });
415
+ test('ProtocolExplicit1', () => {
416
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocolExplicit1.py']);
417
+ TestUtils.validateResults(analysisResults, 5);
418
+ });
419
+ test('ProtocolExplicit3', () => {
420
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['protocolExplicit3.py']);
421
+ TestUtils.validateResults(analysisResults, 3);
422
+ });
423
+ test('TypedDict1', () => {
424
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict1.py']);
425
+ TestUtils.validateResults(analysisResults, 11);
426
+ });
427
+ test('TypedDict2', () => {
428
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict2.py']);
429
+ TestUtils.validateResults(analysisResults, 4);
430
+ });
431
+ test('TypedDict3', () => {
432
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict3.py']);
433
+ TestUtils.validateResults(analysisResults, 4);
434
+ });
435
+ test('TypedDict4', () => {
436
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict4.py']);
437
+ TestUtils.validateResults(analysisResults, 7);
438
+ });
439
+ test('TypedDict5', () => {
440
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict5.py']);
441
+ TestUtils.validateResults(analysisResults, 4);
442
+ });
443
+ test('TypedDict6', () => {
444
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict6.py']);
445
+ TestUtils.validateResults(analysisResults, 13);
446
+ });
447
+ test('TypedDict7', () => {
448
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict7.py']);
449
+ TestUtils.validateResults(analysisResults, 0);
450
+ });
451
+ test('TypedDict8', () => {
452
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict8.py']);
453
+ TestUtils.validateResults(analysisResults, 2);
454
+ });
455
+ test('TypedDict9', () => {
456
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict9.py']);
457
+ TestUtils.validateResults(analysisResults, 1);
458
+ });
459
+ test('TypedDict10', () => {
460
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict10.py']);
461
+ TestUtils.validateResults(analysisResults, 3);
462
+ });
463
+ test('TypedDict11', () => {
464
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict11.py']);
465
+ TestUtils.validateResults(analysisResults, 0);
466
+ });
467
+ test('TypedDict12', () => {
468
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict12.py']);
469
+ TestUtils.validateResults(analysisResults, 5);
470
+ });
471
+ test('TypedDict13', () => {
472
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict13.py']);
473
+ TestUtils.validateResults(analysisResults, 4);
474
+ });
475
+ test('TypedDict14', () => {
476
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict14.py']);
477
+ TestUtils.validateResults(analysisResults, 1);
478
+ });
479
+ test('TypedDict15', () => {
480
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict15.py']);
481
+ TestUtils.validateResults(analysisResults, 2);
482
+ });
483
+ test('TypedDict16', () => {
484
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict16.py']);
485
+ TestUtils.validateResults(analysisResults, 9);
486
+ });
487
+ test('TypedDict17', () => {
488
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict17.py']);
489
+ TestUtils.validateResults(analysisResults, 2);
490
+ });
491
+ test('TypedDict18', () => {
492
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict18.py']);
493
+ TestUtils.validateResults(analysisResults, 3);
494
+ });
495
+ test('TypedDict19', () => {
496
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict19.py']);
497
+ TestUtils.validateResults(analysisResults, 2);
498
+ });
499
+ test('TypedDict20', () => {
500
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict20.py']);
501
+ TestUtils.validateResults(analysisResults, 0);
502
+ });
503
+ test('TypedDict21', () => {
504
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict21.py']);
505
+ TestUtils.validateResults(analysisResults, 1);
506
+ });
507
+ test('TypedDict22', () => {
508
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict22.py']);
509
+ TestUtils.validateResults(analysisResults, 0);
510
+ });
511
+ test('TypedDict23', () => {
512
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict23.py']);
513
+ TestUtils.validateResults(analysisResults, 2);
514
+ });
515
+ test('TypedDict24', () => {
516
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDict24.py']);
517
+ TestUtils.validateResults(analysisResults, 1);
518
+ });
519
+ test('TypedDictInline1', () => {
520
+ const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
521
+ configOptions.diagnosticRuleSet.enableExperimentalFeatures = true;
522
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typedDictInline1.py'], configOptions);
523
+ TestUtils.validateResults(analysisResults, 8);
524
+ });
525
+ test('ClassVar1', () => {
526
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['classVar1.py']);
527
+ TestUtils.validateResults(analysisResults, 1);
528
+ });
529
+ test('ClassVar2', () => {
530
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['classVar2.py']);
531
+ TestUtils.validateResults(analysisResults, 1);
532
+ });
533
+ test('ClassVar3', () => {
534
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['classVar3.py']);
535
+ TestUtils.validateResults(analysisResults, 10);
536
+ });
537
+ test('ClassVar4', () => {
538
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['classVar4.py']);
539
+ TestUtils.validateResults(analysisResults, 0);
540
+ });
541
+ test('TypeVar1', () => {
542
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar1.py']);
543
+ TestUtils.validateResults(analysisResults, 3);
544
+ });
545
+ test('TypeVar2', () => {
546
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar2.py']);
547
+ TestUtils.validateResults(analysisResults, 0);
548
+ });
549
+ test('TypeVar3', () => {
550
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar3.py']);
551
+ TestUtils.validateResults(analysisResults, 12);
552
+ });
553
+ test('TypeVar4', () => {
554
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar4.py']);
555
+ TestUtils.validateResults(analysisResults, 4);
556
+ });
557
+ test('TypeVar5', () => {
558
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar5.py']);
559
+ TestUtils.validateResults(analysisResults, 18);
560
+ });
561
+ test('TypeVar6', () => {
562
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar6.py']);
563
+ TestUtils.validateResults(analysisResults, 20);
564
+ });
565
+ test('TypeVar7', () => {
566
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar7.py']);
567
+ TestUtils.validateResults(analysisResults, 26);
568
+ });
569
+ test('TypeVar8', () => {
570
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar8.py']);
571
+ TestUtils.validateResults(analysisResults, 4);
572
+ });
573
+ test('TypeVar9', () => {
574
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar9.py']);
575
+ TestUtils.validateResults(analysisResults, 13);
576
+ });
577
+ test('TypeVar10', () => {
578
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar10.py']);
579
+ TestUtils.validateResults(analysisResults, 0);
580
+ });
581
+ test('TypeVar11', () => {
582
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar11.py']);
583
+ TestUtils.validateResults(analysisResults, 0);
584
+ });
585
+ test('TypeVar12', () => {
586
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeVar12.py']);
587
+ TestUtils.validateResults(analysisResults, 6);
588
+ });
589
+ test('Annotated1', () => {
590
+ const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
591
+ configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_8;
592
+ const analysisResults38 = TestUtils.typeAnalyzeSampleFiles(['annotated1.py'], configOptions);
593
+ TestUtils.validateResults(analysisResults38, 6);
594
+ configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
595
+ const analysisResults39 = TestUtils.typeAnalyzeSampleFiles(['annotated1.py'], configOptions);
596
+ TestUtils.validateResults(analysisResults39, 3);
597
+ });
598
+ test('Annotated2', () => {
599
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['annotated2.py']);
600
+ TestUtils.validateResults(analysisResults, 0);
601
+ });
602
+ test('Circular1', () => {
603
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['circular1.py']);
604
+ TestUtils.validateResults(analysisResults, 2);
605
+ });
606
+ test('Circular2', () => {
607
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['circular2.py']);
608
+ TestUtils.validateResults(analysisResults, 0);
609
+ });
610
+ test('TryExcept1', () => {
611
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept1.py']);
612
+ TestUtils.validateResults(analysisResults, 4);
613
+ });
614
+ test('TryExcept2', () => {
615
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept2.py']);
616
+ TestUtils.validateResults(analysisResults, 0);
617
+ });
618
+ test('TryExcept3', () => {
619
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept3.py']);
620
+ TestUtils.validateResults(analysisResults, 0);
621
+ });
622
+ test('TryExcept4', () => {
623
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept4.py']);
624
+ TestUtils.validateResults(analysisResults, 2);
625
+ });
626
+ test('TryExcept5', () => {
627
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept5.py']);
628
+ TestUtils.validateResults(analysisResults, 1);
629
+ });
630
+ test('TryExcept6', () => {
631
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept6.py']);
632
+ TestUtils.validateResults(analysisResults, 1);
633
+ });
634
+ test('TryExcept7', () => {
635
+ const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
636
+ configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_10;
637
+ const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['tryExcept7.py'], configOptions);
638
+ TestUtils.validateResults(analysisResults1, 3);
639
+ configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
640
+ const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['tryExcept7.py'], configOptions);
641
+ TestUtils.validateResults(analysisResults2, 0);
642
+ });
643
+ test('TryExcept8', () => {
644
+ const configOptions = new configOptions_1.ConfigOptions(uri_1.Uri.empty());
645
+ configOptions.defaultPythonVersion = pythonVersion_1.pythonVersion3_11;
646
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept8.py'], configOptions);
647
+ TestUtils.validateResults(analysisResults, 3);
648
+ });
649
+ test('TryExcept9', () => {
650
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept9.py']);
651
+ TestUtils.validateResults(analysisResults, 0);
652
+ });
653
+ test('TryExcept10', () => {
654
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept10.py']);
655
+ TestUtils.validateResults(analysisResults, 1);
656
+ });
657
+ test('TryExcept11', () => {
658
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['tryExcept11.py']);
659
+ TestUtils.validateResults(analysisResults, 0);
660
+ });
661
+ test('Del1', () => {
662
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['del1.py']);
663
+ TestUtils.validateResults(analysisResults, 6);
664
+ });
665
+ test('Del2', () => {
666
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['del2.py']);
667
+ TestUtils.validateResults(analysisResults, 2);
668
+ });
669
+ test('Any1', () => {
670
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['any1.py']);
671
+ TestUtils.validateResults(analysisResults, 4);
672
+ });
673
+ test('Type1', () => {
674
+ const analysisResults = TestUtils.typeAnalyzeSampleFiles(['type1.py']);
675
+ TestUtils.validateResults(analysisResults, 8);
676
+ });
677
+ //# sourceMappingURL=typeEvaluator7.test.js.map