@zzzen/pyright-internal 1.2.0-dev.20230618 → 1.2.0-dev.20230625
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.
- package/dist/analyzer/codeFlowEngine.js +28 -4
- package/dist/analyzer/codeFlowEngine.js.map +1 -1
- package/dist/analyzer/codeFlowUtils.js +2 -0
- package/dist/analyzer/codeFlowUtils.js.map +1 -1
- package/dist/analyzer/constraintSolver.js +15 -1
- package/dist/analyzer/constraintSolver.js.map +1 -1
- package/dist/analyzer/constructors.js +6 -2
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/dataClasses.js +64 -0
- package/dist/analyzer/dataClasses.js.map +1 -1
- package/dist/analyzer/decorators.d.ts +7 -0
- package/dist/analyzer/decorators.js +438 -0
- package/dist/analyzer/decorators.js.map +1 -0
- package/dist/analyzer/operations.d.ts +1 -1
- package/dist/analyzer/operations.js +4 -4
- package/dist/analyzer/operations.js.map +1 -1
- package/dist/analyzer/parameterUtils.d.ts +2 -1
- package/dist/analyzer/parameterUtils.js +1 -0
- package/dist/analyzer/parameterUtils.js.map +1 -1
- package/dist/analyzer/protocols.js +2 -2
- package/dist/analyzer/protocols.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +191 -577
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/analyzer/typeEvaluatorTypes.d.ts +3 -2
- package/dist/analyzer/typeEvaluatorTypes.js +2 -2
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -1
- package/dist/analyzer/typeGuards.js +21 -18
- package/dist/analyzer/typeGuards.js.map +1 -1
- package/dist/analyzer/typePrinter.d.ts +2 -1
- package/dist/analyzer/typePrinter.js +27 -5
- package/dist/analyzer/typePrinter.js.map +1 -1
- package/dist/analyzer/typeUtils.d.ts +3 -1
- package/dist/analyzer/typeUtils.js +30 -10
- package/dist/analyzer/typeUtils.js.map +1 -1
- package/dist/analyzer/typedDicts.js +9 -11
- package/dist/analyzer/typedDicts.js.map +1 -1
- package/dist/analyzer/types.d.ts +5 -3
- package/dist/analyzer/types.js +49 -11
- package/dist/analyzer/types.js.map +1 -1
- package/dist/common/extensibility.d.ts +3 -3
- package/dist/common/extensibility.js.map +1 -1
- package/dist/languageService/hoverProvider.js +13 -9
- package/dist/languageService/hoverProvider.js.map +1 -1
- package/dist/localization/localize.d.ts +0 -4
- package/dist/localization/localize.js +0 -1
- package/dist/localization/localize.js.map +1 -1
- package/dist/localization/package.nls.en-us.json +0 -1
- package/dist/pyright.js +39 -2
- package/dist/pyright.js.map +1 -1
- package/dist/tests/checker.test.js +1 -1
- package/dist/tests/fourslash/completions.typeAlias.fourslash.js +1 -1
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.docstring.alias.fourslash.js +3 -3
- package/dist/tests/fourslash/hover.init.fourslash.js +1 -1
- package/dist/tests/fourslash/hover.variable.docString.fourslash.js +1 -1
- package/dist/tests/positionUtils.test.js +10 -0
- package/dist/tests/positionUtils.test.js.map +1 -1
- package/dist/tests/tokenizer.test.js +12 -1
- package/dist/tests/tokenizer.test.js.map +1 -1
- package/dist/tests/typeEvaluator1.test.js +184 -136
- package/dist/tests/typeEvaluator1.test.js.map +1 -1
- package/dist/tests/typeEvaluator2.test.js +248 -330
- package/dist/tests/typeEvaluator2.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +218 -177
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +58 -46
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/tests/typePrinter.test.js +2 -2
- package/package.json +1 -1
@@ -41,70 +41,70 @@ test('Module2', () => {
|
|
41
41
|
});
|
42
42
|
test('Ellipsis1', () => {
|
43
43
|
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['ellipsis1.pyi']);
|
44
|
-
TestUtils.validateResults(analysisResults,
|
44
|
+
TestUtils.validateResults(analysisResults, 11);
|
45
45
|
});
|
46
|
-
test('
|
47
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
46
|
+
test('Generator1', () => {
|
47
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator1.py']);
|
48
48
|
TestUtils.validateResults(analysisResults, 9);
|
49
49
|
});
|
50
|
-
test('
|
51
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
50
|
+
test('Generator2', () => {
|
51
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator2.py']);
|
52
52
|
TestUtils.validateResults(analysisResults, 2);
|
53
53
|
});
|
54
|
-
test('
|
55
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
54
|
+
test('Generator3', () => {
|
55
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator3.py']);
|
56
56
|
TestUtils.validateResults(analysisResults, 1);
|
57
57
|
});
|
58
|
-
test('
|
59
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
58
|
+
test('Generator4', () => {
|
59
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator4.py']);
|
60
60
|
TestUtils.validateResults(analysisResults, 0);
|
61
61
|
});
|
62
|
-
test('
|
63
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
62
|
+
test('Generator5', () => {
|
63
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator5.py']);
|
64
64
|
TestUtils.validateResults(analysisResults, 0);
|
65
65
|
});
|
66
|
-
test('
|
67
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
66
|
+
test('Generator6', () => {
|
67
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator6.py']);
|
68
68
|
TestUtils.validateResults(analysisResults, 0);
|
69
69
|
});
|
70
|
-
test('
|
71
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
70
|
+
test('Generator7', () => {
|
71
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator7.py']);
|
72
72
|
TestUtils.validateResults(analysisResults, 0);
|
73
73
|
});
|
74
|
-
test('
|
75
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
74
|
+
test('Generator8', () => {
|
75
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator8.py']);
|
76
76
|
TestUtils.validateResults(analysisResults, 0);
|
77
77
|
});
|
78
|
-
test('
|
79
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
78
|
+
test('Generator9', () => {
|
79
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator9.py']);
|
80
80
|
TestUtils.validateResults(analysisResults, 2);
|
81
81
|
});
|
82
|
-
test('
|
83
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
82
|
+
test('Generator10', () => {
|
83
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator10.py']);
|
84
84
|
TestUtils.validateResults(analysisResults, 0);
|
85
85
|
});
|
86
|
-
test('
|
87
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
86
|
+
test('Generator11', () => {
|
87
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator11.py']);
|
88
88
|
TestUtils.validateResults(analysisResults, 2);
|
89
89
|
});
|
90
|
-
test('
|
91
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
90
|
+
test('Generator12', () => {
|
91
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator12.py']);
|
92
92
|
TestUtils.validateResults(analysisResults, 1);
|
93
93
|
});
|
94
|
-
test('
|
95
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
94
|
+
test('Generator13', () => {
|
95
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator13.py']);
|
96
96
|
TestUtils.validateResults(analysisResults, 0);
|
97
97
|
});
|
98
|
-
test('
|
99
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
98
|
+
test('Generator14', () => {
|
99
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator14.py']);
|
100
100
|
TestUtils.validateResults(analysisResults, 0);
|
101
101
|
});
|
102
|
-
test('
|
103
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
102
|
+
test('Generator15', () => {
|
103
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator15.py']);
|
104
104
|
TestUtils.validateResults(analysisResults, 3);
|
105
105
|
});
|
106
|
-
test('
|
107
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
106
|
+
test('Generator16', () => {
|
107
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['generator16.py']);
|
108
108
|
TestUtils.validateResults(analysisResults, 1);
|
109
109
|
});
|
110
110
|
test('Await1', () => {
|
@@ -135,152 +135,156 @@ test('Coroutines3', () => {
|
|
135
135
|
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['coroutines3.py'], configOptions);
|
136
136
|
TestUtils.validateResults(analysisResults, 0);
|
137
137
|
});
|
138
|
-
test('
|
139
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
138
|
+
test('Loop1', () => {
|
139
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop1.py']);
|
140
140
|
TestUtils.validateResults(analysisResults, 2);
|
141
141
|
});
|
142
|
-
test('
|
143
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
142
|
+
test('Loop2', () => {
|
143
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop2.py']);
|
144
144
|
TestUtils.validateResults(analysisResults, 0);
|
145
145
|
});
|
146
|
-
test('
|
147
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
146
|
+
test('Loop3', () => {
|
147
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop3.py']);
|
148
148
|
TestUtils.validateResults(analysisResults, 0);
|
149
149
|
});
|
150
|
-
test('
|
151
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
150
|
+
test('Loop4', () => {
|
151
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop4.py']);
|
152
152
|
TestUtils.validateResults(analysisResults, 0);
|
153
153
|
});
|
154
|
-
test('
|
155
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
154
|
+
test('Loop5', () => {
|
155
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop5.py']);
|
156
156
|
TestUtils.validateResults(analysisResults, 0);
|
157
157
|
});
|
158
|
-
test('
|
159
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
158
|
+
test('Loop6', () => {
|
159
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop6.py']);
|
160
160
|
TestUtils.validateResults(analysisResults, 0);
|
161
161
|
});
|
162
|
-
test('
|
163
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
162
|
+
test('Loop7', () => {
|
163
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop7.py']);
|
164
164
|
TestUtils.validateResults(analysisResults, 0);
|
165
165
|
});
|
166
|
-
test('
|
167
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
166
|
+
test('Loop8', () => {
|
167
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop8.py']);
|
168
168
|
TestUtils.validateResults(analysisResults, 0);
|
169
169
|
});
|
170
|
-
test('
|
171
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
170
|
+
test('Loop9', () => {
|
171
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop9.py']);
|
172
172
|
TestUtils.validateResults(analysisResults, 0);
|
173
173
|
});
|
174
|
-
test('
|
175
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
174
|
+
test('Loop10', () => {
|
175
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop10.py']);
|
176
176
|
TestUtils.validateResults(analysisResults, 0);
|
177
177
|
});
|
178
|
-
test('
|
179
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
178
|
+
test('Loop11', () => {
|
179
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop11.py']);
|
180
180
|
TestUtils.validateResults(analysisResults, 3);
|
181
181
|
});
|
182
|
-
test('
|
183
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
182
|
+
test('Loop12', () => {
|
183
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop12.py']);
|
184
184
|
TestUtils.validateResults(analysisResults, 1);
|
185
185
|
});
|
186
|
-
test('
|
187
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
186
|
+
test('Loop13', () => {
|
187
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop13.py']);
|
188
188
|
TestUtils.validateResults(analysisResults, 0);
|
189
189
|
});
|
190
|
-
test('
|
191
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
190
|
+
test('Loop14', () => {
|
191
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop14.py']);
|
192
192
|
TestUtils.validateResults(analysisResults, 0);
|
193
193
|
});
|
194
|
-
test('
|
195
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
194
|
+
test('Loop15', () => {
|
195
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop15.py']);
|
196
196
|
TestUtils.validateResults(analysisResults, 0);
|
197
197
|
});
|
198
|
-
test('
|
199
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
198
|
+
test('Loop16', () => {
|
199
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop16.py']);
|
200
200
|
TestUtils.validateResults(analysisResults, 0);
|
201
201
|
});
|
202
|
-
test('
|
203
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
202
|
+
test('Loop17', () => {
|
203
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop17.py']);
|
204
204
|
TestUtils.validateResults(analysisResults, 0);
|
205
205
|
});
|
206
|
-
test('
|
207
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
206
|
+
test('Loop18', () => {
|
207
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop18.py']);
|
208
208
|
TestUtils.validateResults(analysisResults, 0);
|
209
209
|
});
|
210
|
-
test('
|
211
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
210
|
+
test('Loop19', () => {
|
211
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop19.py']);
|
212
212
|
TestUtils.validateResults(analysisResults, 0);
|
213
213
|
});
|
214
|
-
test('
|
215
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
214
|
+
test('Loop20', () => {
|
215
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop20.py']);
|
216
216
|
TestUtils.validateResults(analysisResults, 0);
|
217
217
|
});
|
218
|
-
test('
|
219
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
218
|
+
test('Loop21', () => {
|
219
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop21.py']);
|
220
220
|
TestUtils.validateResults(analysisResults, 0);
|
221
221
|
});
|
222
|
-
test('
|
223
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
222
|
+
test('Loop22', () => {
|
223
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop22.py']);
|
224
224
|
TestUtils.validateResults(analysisResults, 0);
|
225
225
|
});
|
226
|
-
test('
|
227
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
226
|
+
test('Loop23', () => {
|
227
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop23.py']);
|
228
228
|
TestUtils.validateResults(analysisResults, 0);
|
229
229
|
});
|
230
|
-
test('
|
231
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
230
|
+
test('Loop24', () => {
|
231
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop24.py']);
|
232
232
|
TestUtils.validateResults(analysisResults, 0);
|
233
233
|
});
|
234
|
-
test('
|
235
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
234
|
+
test('Loop25', () => {
|
235
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop25.py']);
|
236
236
|
TestUtils.validateResults(analysisResults, 0);
|
237
237
|
});
|
238
|
-
test('
|
239
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
238
|
+
test('Loop26', () => {
|
239
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop26.py']);
|
240
240
|
TestUtils.validateResults(analysisResults, 0);
|
241
241
|
});
|
242
|
-
test('
|
243
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
242
|
+
test('Loop27', () => {
|
243
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop27.py']);
|
244
244
|
TestUtils.validateResults(analysisResults, 0);
|
245
245
|
});
|
246
|
-
test('
|
247
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
246
|
+
test('Loop28', () => {
|
247
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop28.py']);
|
248
248
|
TestUtils.validateResults(analysisResults, 0);
|
249
249
|
});
|
250
|
-
test('
|
251
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
250
|
+
test('Loop29', () => {
|
251
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop29.py']);
|
252
252
|
TestUtils.validateResults(analysisResults, 0);
|
253
253
|
});
|
254
|
-
test('
|
255
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
254
|
+
test('Loop30', () => {
|
255
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop30.py']);
|
256
256
|
TestUtils.validateResults(analysisResults, 0);
|
257
257
|
});
|
258
|
-
test('
|
259
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
258
|
+
test('Loop31', () => {
|
259
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop31.py']);
|
260
260
|
TestUtils.validateResults(analysisResults, 1);
|
261
261
|
});
|
262
|
-
test('
|
263
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
262
|
+
test('Loop32', () => {
|
263
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop32.py']);
|
264
|
+
TestUtils.validateResults(analysisResults, 0);
|
265
|
+
});
|
266
|
+
test('Loop33', () => {
|
267
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop33.py']);
|
264
268
|
TestUtils.validateResults(analysisResults, 0);
|
265
269
|
});
|
266
|
-
test('
|
267
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
270
|
+
test('Loop34', () => {
|
271
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop34.py']);
|
268
272
|
TestUtils.validateResults(analysisResults, 0);
|
269
273
|
});
|
270
|
-
test('
|
271
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
274
|
+
test('Loop35', () => {
|
275
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop35.py']);
|
272
276
|
TestUtils.validateResults(analysisResults, 0);
|
273
277
|
});
|
274
|
-
test('
|
275
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
278
|
+
test('Loop36', () => {
|
279
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop36.py']);
|
276
280
|
TestUtils.validateResults(analysisResults, 0);
|
277
281
|
});
|
278
|
-
test('
|
279
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
282
|
+
test('Loop37', () => {
|
283
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop37.py']);
|
280
284
|
TestUtils.validateResults(analysisResults, 0);
|
281
285
|
});
|
282
|
-
test('
|
283
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
286
|
+
test('Loop38', () => {
|
287
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['loop38.py']);
|
284
288
|
TestUtils.validateResults(analysisResults, 0);
|
285
289
|
});
|
286
290
|
test('ForLoop1', () => {
|
@@ -291,44 +295,44 @@ test('ForLoop2', () => {
|
|
291
295
|
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['forLoop2.py']);
|
292
296
|
TestUtils.validateResults(analysisResults, 7);
|
293
297
|
});
|
294
|
-
test('
|
295
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
298
|
+
test('Comprehension1', () => {
|
299
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension1.py']);
|
296
300
|
TestUtils.validateResults(analysisResults, 2);
|
297
301
|
});
|
298
|
-
test('
|
299
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
302
|
+
test('Comprehension2', () => {
|
303
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension2.py']);
|
300
304
|
TestUtils.validateResults(analysisResults, 0);
|
301
305
|
});
|
302
|
-
test('
|
303
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
306
|
+
test('Comprehension3', () => {
|
307
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension3.py']);
|
304
308
|
TestUtils.validateResults(analysisResults, 0);
|
305
309
|
});
|
306
|
-
test('
|
307
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
310
|
+
test('Comprehension4', () => {
|
311
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension4.py']);
|
308
312
|
TestUtils.validateResults(analysisResults, 0);
|
309
313
|
});
|
310
|
-
test('
|
311
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
314
|
+
test('Comprehension5', () => {
|
315
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension5.py']);
|
312
316
|
TestUtils.validateResults(analysisResults, 0);
|
313
317
|
});
|
314
|
-
test('
|
315
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
318
|
+
test('Comprehension6', () => {
|
319
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension6.py']);
|
316
320
|
TestUtils.validateResults(analysisResults, 4);
|
317
321
|
});
|
318
|
-
test('
|
319
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
322
|
+
test('Comprehension7', () => {
|
323
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension7.py']);
|
320
324
|
TestUtils.validateResults(analysisResults, 1);
|
321
325
|
});
|
322
|
-
test('
|
323
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
326
|
+
test('Comprehension8', () => {
|
327
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension8.py']);
|
324
328
|
TestUtils.validateResults(analysisResults, 0);
|
325
329
|
});
|
326
|
-
test('
|
327
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
330
|
+
test('Comprehension9', () => {
|
331
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension9.py']);
|
328
332
|
TestUtils.validateResults(analysisResults, 0);
|
329
333
|
});
|
330
|
-
test('
|
331
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
334
|
+
test('Comprehension10', () => {
|
335
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['comprehension10.py']);
|
332
336
|
TestUtils.validateResults(analysisResults, 1);
|
333
337
|
});
|
334
338
|
test('Literals1', () => {
|
@@ -444,6 +448,14 @@ test('TypeAlias20', () => {
|
|
444
448
|
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAlias20.py']);
|
445
449
|
TestUtils.validateResults(analysisResults, 0);
|
446
450
|
});
|
451
|
+
test('TypeAlias21', () => {
|
452
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAlias21.py']);
|
453
|
+
TestUtils.validateResults(analysisResults, 0);
|
454
|
+
});
|
455
|
+
test('TypeAlias22', () => {
|
456
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['typeAlias22.py']);
|
457
|
+
TestUtils.validateResults(analysisResults, 6);
|
458
|
+
});
|
447
459
|
test('RecursiveTypeAlias1', () => {
|
448
460
|
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['recursiveTypeAlias1.py']);
|
449
461
|
TestUtils.validateResults(analysisResults, 13);
|
@@ -596,44 +608,44 @@ test('MethodOverride6', () => {
|
|
596
608
|
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['methodOverride6.py'], configOptions);
|
597
609
|
TestUtils.validateResults(analysisResults2, 2);
|
598
610
|
});
|
599
|
-
test('
|
600
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
611
|
+
test('Enum1', () => {
|
612
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enum1.py']);
|
601
613
|
TestUtils.validateResults(analysisResults, 3);
|
602
614
|
});
|
603
|
-
test('
|
604
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
605
|
-
TestUtils.validateResults(analysisResults, 0);
|
606
|
-
});
|
607
|
-
test('Enums3', () => {
|
608
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enums3.py']);
|
615
|
+
test('Enum2', () => {
|
616
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enum2.py']);
|
609
617
|
TestUtils.validateResults(analysisResults, 0);
|
610
618
|
});
|
611
|
-
test('
|
612
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
619
|
+
test('Enum3', () => {
|
620
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enum3.py']);
|
613
621
|
TestUtils.validateResults(analysisResults, 0);
|
614
622
|
});
|
615
|
-
test('
|
616
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
623
|
+
test('Enum4', () => {
|
624
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enum4.py']);
|
617
625
|
TestUtils.validateResults(analysisResults, 0);
|
618
626
|
});
|
619
|
-
test('
|
620
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
627
|
+
test('Enum5', () => {
|
628
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enum5.py']);
|
621
629
|
TestUtils.validateResults(analysisResults, 0);
|
622
630
|
});
|
623
|
-
test('
|
624
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
631
|
+
test('Enum6', () => {
|
632
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enum6.py']);
|
625
633
|
TestUtils.validateResults(analysisResults, 4);
|
626
634
|
});
|
627
|
-
test('
|
628
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
635
|
+
test('Enum7', () => {
|
636
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enum7.py']);
|
629
637
|
TestUtils.validateResults(analysisResults, 1);
|
630
638
|
});
|
631
|
-
test('
|
632
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
639
|
+
test('Enum8', () => {
|
640
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enum8.py']);
|
641
|
+
TestUtils.validateResults(analysisResults, 0);
|
642
|
+
});
|
643
|
+
test('EnumAuto1', () => {
|
644
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enumAuto1.py']);
|
633
645
|
TestUtils.validateResults(analysisResults, 0);
|
634
646
|
});
|
635
|
-
test('
|
636
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
647
|
+
test('EnumGenNextValue1', () => {
|
648
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['enumGenNextValue1.py']);
|
637
649
|
TestUtils.validateResults(analysisResults, 0);
|
638
650
|
});
|
639
651
|
test('TypeGuard1', () => {
|
@@ -830,69 +842,69 @@ test('Match3', () => {
|
|
830
842
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
831
843
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
832
844
|
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['match3.py'], configOptions);
|
833
|
-
TestUtils.validateResults(analysisResults,
|
845
|
+
TestUtils.validateResults(analysisResults, 0);
|
834
846
|
});
|
835
|
-
test('
|
847
|
+
test('MatchSequence1', () => {
|
836
848
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
837
849
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
838
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
839
|
-
TestUtils.validateResults(analysisResults,
|
850
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchSequence1.py'], configOptions);
|
851
|
+
TestUtils.validateResults(analysisResults, 2);
|
840
852
|
});
|
841
|
-
test('
|
853
|
+
test('MatchClass1', () => {
|
842
854
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
843
855
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
844
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
845
|
-
TestUtils.validateResults(analysisResults,
|
856
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass1.py'], configOptions);
|
857
|
+
TestUtils.validateResults(analysisResults, 4);
|
846
858
|
});
|
847
|
-
test('
|
859
|
+
test('MatchClass2', () => {
|
848
860
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
849
861
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
850
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
862
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass2.py'], configOptions);
|
851
863
|
TestUtils.validateResults(analysisResults, 0);
|
852
864
|
});
|
853
|
-
test('
|
865
|
+
test('MatchClass3', () => {
|
854
866
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
855
867
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
856
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
857
|
-
TestUtils.validateResults(analysisResults,
|
868
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchClass3.py'], configOptions);
|
869
|
+
TestUtils.validateResults(analysisResults, 0);
|
858
870
|
});
|
859
|
-
test('
|
871
|
+
test('MatchValue1', () => {
|
860
872
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
861
873
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
862
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
874
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchValue1.py'], configOptions);
|
863
875
|
TestUtils.validateResults(analysisResults, 0);
|
864
876
|
});
|
865
|
-
test('
|
877
|
+
test('MatchMapping1', () => {
|
866
878
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
867
879
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
868
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['
|
880
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchMapping1.py'], configOptions);
|
881
|
+
TestUtils.validateResults(analysisResults, 2);
|
882
|
+
});
|
883
|
+
test('MatchLiteral1', () => {
|
884
|
+
const configOptions = new configOptions_1.ConfigOptions('.');
|
885
|
+
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
886
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['matchLiteral1.py'], configOptions);
|
869
887
|
TestUtils.validateResults(analysisResults, 0);
|
870
888
|
});
|
871
|
-
test('
|
889
|
+
test('MatchExhaustion1', () => {
|
872
890
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
873
891
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
874
892
|
configOptions.diagnosticRuleSet.reportMatchNotExhaustive = 'none';
|
875
|
-
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['
|
893
|
+
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['matchExhaustion1.py'], configOptions);
|
876
894
|
TestUtils.validateResults(analysisResults1, 0);
|
877
895
|
configOptions.diagnosticRuleSet.reportMatchNotExhaustive = 'error';
|
878
|
-
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['
|
896
|
+
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['matchExhaustion1.py'], configOptions);
|
879
897
|
TestUtils.validateResults(analysisResults2, 4);
|
880
898
|
});
|
881
|
-
test('
|
899
|
+
test('MatchUnnecessary1', () => {
|
882
900
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
883
901
|
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
884
|
-
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['
|
902
|
+
const analysisResults1 = TestUtils.typeAnalyzeSampleFiles(['matchUnnecessary1.py'], configOptions);
|
885
903
|
TestUtils.validateResults(analysisResults1, 0);
|
886
904
|
configOptions.diagnosticRuleSet.reportUnnecessaryComparison = 'error';
|
887
|
-
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['
|
905
|
+
const analysisResults2 = TestUtils.typeAnalyzeSampleFiles(['matchUnnecessary1.py'], configOptions);
|
888
906
|
TestUtils.validateResults(analysisResults2, 7);
|
889
907
|
});
|
890
|
-
test('Match12', () => {
|
891
|
-
const configOptions = new configOptions_1.ConfigOptions('.');
|
892
|
-
configOptions.defaultPythonVersion = pythonVersion_1.PythonVersion.V3_10;
|
893
|
-
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['match12.py'], configOptions);
|
894
|
-
TestUtils.validateResults(analysisResults, 0);
|
895
|
-
});
|
896
908
|
test('List1', () => {
|
897
909
|
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['list1.py']);
|
898
910
|
TestUtils.validateResults(analysisResults, 3);
|
@@ -1017,6 +1029,35 @@ test('Constructor19', () => {
|
|
1017
1029
|
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor19.py']);
|
1018
1030
|
TestUtils.validateResults(analysisResults, 1);
|
1019
1031
|
});
|
1032
|
+
test('Constructor20', () => {
|
1033
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor20.py']);
|
1034
|
+
TestUtils.validateResults(analysisResults, 2);
|
1035
|
+
});
|
1036
|
+
test('Constructor21', () => {
|
1037
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor21.py']);
|
1038
|
+
TestUtils.validateResults(analysisResults, 1);
|
1039
|
+
});
|
1040
|
+
test('Constructor22', () => {
|
1041
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor22.py']);
|
1042
|
+
TestUtils.validateResults(analysisResults, 0);
|
1043
|
+
});
|
1044
|
+
test('Constructor23', () => {
|
1045
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor23.py']);
|
1046
|
+
TestUtils.validateResults(analysisResults, 0);
|
1047
|
+
});
|
1048
|
+
test('Constructor24', () => {
|
1049
|
+
const configOptions = new configOptions_1.ConfigOptions('.');
|
1050
|
+
configOptions.diagnosticRuleSet.strictParameterNoneValue = false;
|
1051
|
+
let analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor24.py'], configOptions);
|
1052
|
+
TestUtils.validateResults(analysisResults, 4);
|
1053
|
+
configOptions.diagnosticRuleSet.strictParameterNoneValue = true;
|
1054
|
+
analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor24.py'], configOptions);
|
1055
|
+
TestUtils.validateResults(analysisResults, 5);
|
1056
|
+
});
|
1057
|
+
test('Constructor25', () => {
|
1058
|
+
const analysisResults = TestUtils.typeAnalyzeSampleFiles(['constructor25.py']);
|
1059
|
+
TestUtils.validateResults(analysisResults, 1);
|
1060
|
+
});
|
1020
1061
|
test('InconsistentConstructor1', () => {
|
1021
1062
|
const configOptions = new configOptions_1.ConfigOptions('.');
|
1022
1063
|
configOptions.diagnosticRuleSet.reportInconsistentConstructor = 'none';
|