OLD | NEW |
| (Empty) |
1 // This code was auto-generated, is not intended to be edited, and is subject to | |
2 // significant change. Please see the README file for more information. | |
3 | |
4 library engine.parser_test; | |
5 | |
6 import 'dart:collection'; | |
7 import 'package:analyzer-experimental/src/generated/java_core.dart'; | |
8 import 'package:analyzer-experimental/src/generated/java_engine.dart'; | |
9 import 'package:analyzer-experimental/src/generated/java_junit.dart'; | |
10 import 'package:analyzer-experimental/src/generated/source.dart'; | |
11 import 'package:analyzer-experimental/src/generated/error.dart'; | |
12 import 'package:analyzer-experimental/src/generated/scanner.dart'; | |
13 import 'package:analyzer-experimental/src/generated/ast.dart'; | |
14 import 'package:analyzer-experimental/src/generated/parser.dart'; | |
15 import 'package:analyzer-experimental/src/generated/utilities_dart.dart'; | |
16 import 'package:unittest/unittest.dart' as _ut; | |
17 import 'test_support.dart'; | |
18 import 'scanner_test.dart' show TokenFactory; | |
19 | |
20 /** | |
21 * The class {@code SimpleParserTest} defines parser tests that test individual
parsing method. The | |
22 * code fragments should be as minimal as possible in order to test the method,
but should not test | |
23 * the interactions between the method under test and other methods. | |
24 * <p> | |
25 * More complex tests should be defined in the class {@link ComplexParserTest}. | |
26 */ | |
27 class SimpleParserTest extends ParserTestCase { | |
28 void fail_parseCommentReference_this() { | |
29 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["this", 5], ""); | |
30 SimpleIdentifier identifier19 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | |
31 JUnitTestCase.assertNotNull(identifier19.token); | |
32 JUnitTestCase.assertEquals("a", identifier19.name); | |
33 JUnitTestCase.assertEquals(5, identifier19.offset); | |
34 } | |
35 void test_computeStringValue_emptyInterpolationPrefix() { | |
36 JUnitTestCase.assertEquals("", computeStringValue("'''")); | |
37 } | |
38 void test_computeStringValue_escape_b() { | |
39 JUnitTestCase.assertEquals("\b", computeStringValue("'\\b'")); | |
40 } | |
41 void test_computeStringValue_escape_f() { | |
42 JUnitTestCase.assertEquals("\f", computeStringValue("'\\f'")); | |
43 } | |
44 void test_computeStringValue_escape_n() { | |
45 JUnitTestCase.assertEquals("\n", computeStringValue("'\\n'")); | |
46 } | |
47 void test_computeStringValue_escape_notSpecial() { | |
48 JUnitTestCase.assertEquals(":", computeStringValue("'\\:'")); | |
49 } | |
50 void test_computeStringValue_escape_r() { | |
51 JUnitTestCase.assertEquals("\r", computeStringValue("'\\r'")); | |
52 } | |
53 void test_computeStringValue_escape_t() { | |
54 JUnitTestCase.assertEquals("\t", computeStringValue("'\\t'")); | |
55 } | |
56 void test_computeStringValue_escape_u_fixed() { | |
57 JUnitTestCase.assertEquals("\u4321", computeStringValue("'\\u4321'")); | |
58 } | |
59 void test_computeStringValue_escape_u_variable() { | |
60 JUnitTestCase.assertEquals("\u0123", computeStringValue("'\\u{123}'")); | |
61 } | |
62 void test_computeStringValue_escape_v() { | |
63 JUnitTestCase.assertEquals("\u000B", computeStringValue("'\\v'")); | |
64 } | |
65 void test_computeStringValue_escape_x() { | |
66 JUnitTestCase.assertEquals("\u00FF", computeStringValue("'\\xFF'")); | |
67 } | |
68 void test_computeStringValue_noEscape_single() { | |
69 JUnitTestCase.assertEquals("text", computeStringValue("'text'")); | |
70 } | |
71 void test_computeStringValue_noEscape_triple() { | |
72 JUnitTestCase.assertEquals("text", computeStringValue("'''text'''")); | |
73 } | |
74 void test_computeStringValue_raw_single() { | |
75 JUnitTestCase.assertEquals("text", computeStringValue("r'text'")); | |
76 } | |
77 void test_computeStringValue_raw_triple() { | |
78 JUnitTestCase.assertEquals("text", computeStringValue("r'''text'''")); | |
79 } | |
80 void test_computeStringValue_raw_withEscape() { | |
81 JUnitTestCase.assertEquals("two\\nlines", computeStringValue("r'two\\nlines'
")); | |
82 } | |
83 void test_createSyntheticIdentifier() { | |
84 SimpleIdentifier identifier = createSyntheticIdentifier(); | |
85 JUnitTestCase.assertTrue(identifier.isSynthetic()); | |
86 } | |
87 void test_createSyntheticStringLiteral() { | |
88 SimpleStringLiteral literal = createSyntheticStringLiteral(); | |
89 JUnitTestCase.assertTrue(literal.isSynthetic()); | |
90 } | |
91 void test_isFunctionDeclaration_nameButNoReturn_block() { | |
92 JUnitTestCase.assertTrue(isFunctionDeclaration("f() {}")); | |
93 } | |
94 void test_isFunctionDeclaration_nameButNoReturn_expression() { | |
95 JUnitTestCase.assertTrue(isFunctionDeclaration("f() => e")); | |
96 } | |
97 void test_isFunctionDeclaration_normalReturn_block() { | |
98 JUnitTestCase.assertTrue(isFunctionDeclaration("C f() {}")); | |
99 } | |
100 void test_isFunctionDeclaration_normalReturn_expression() { | |
101 JUnitTestCase.assertTrue(isFunctionDeclaration("C f() => e")); | |
102 } | |
103 void test_isFunctionDeclaration_voidReturn_block() { | |
104 JUnitTestCase.assertTrue(isFunctionDeclaration("void f() {}")); | |
105 } | |
106 void test_isFunctionDeclaration_voidReturn_expression() { | |
107 JUnitTestCase.assertTrue(isFunctionDeclaration("void f() => e")); | |
108 } | |
109 void test_isFunctionExpression_false_noBody() { | |
110 JUnitTestCase.assertFalse(isFunctionExpression("f();")); | |
111 } | |
112 void test_isFunctionExpression_false_notParameters() { | |
113 JUnitTestCase.assertFalse(isFunctionExpression("(a + b) {")); | |
114 } | |
115 void test_isFunctionExpression_noName_block() { | |
116 JUnitTestCase.assertTrue(isFunctionExpression("() {}")); | |
117 } | |
118 void test_isFunctionExpression_noName_expression() { | |
119 JUnitTestCase.assertTrue(isFunctionExpression("() => e")); | |
120 } | |
121 void test_isFunctionExpression_parameter_multiple() { | |
122 JUnitTestCase.assertTrue(isFunctionExpression("(a, b) {}")); | |
123 } | |
124 void test_isFunctionExpression_parameter_named() { | |
125 JUnitTestCase.assertTrue(isFunctionExpression("({a}) {}")); | |
126 } | |
127 void test_isFunctionExpression_parameter_optional() { | |
128 JUnitTestCase.assertTrue(isFunctionExpression("([a]) {}")); | |
129 } | |
130 void test_isFunctionExpression_parameter_single() { | |
131 JUnitTestCase.assertTrue(isFunctionExpression("(a) {}")); | |
132 } | |
133 void test_isFunctionExpression_parameter_typed() { | |
134 JUnitTestCase.assertTrue(isFunctionExpression("(int a, int b) {}")); | |
135 } | |
136 void test_isInitializedVariableDeclaration_assignment() { | |
137 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a = null;")); | |
138 } | |
139 void test_isInitializedVariableDeclaration_comparison() { | |
140 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a < 0;")); | |
141 } | |
142 void test_isInitializedVariableDeclaration_conditional() { | |
143 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("a == null ? init
() : update();")); | |
144 } | |
145 void test_isInitializedVariableDeclaration_const_noType_initialized() { | |
146 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const a = 0;")); | |
147 } | |
148 void test_isInitializedVariableDeclaration_const_noType_uninitialized() { | |
149 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const a;")); | |
150 } | |
151 void test_isInitializedVariableDeclaration_const_simpleType_uninitialized() { | |
152 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("const A a;")); | |
153 } | |
154 void test_isInitializedVariableDeclaration_final_noType_initialized() { | |
155 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final a = 0;")); | |
156 } | |
157 void test_isInitializedVariableDeclaration_final_noType_uninitialized() { | |
158 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final a;")); | |
159 } | |
160 void test_isInitializedVariableDeclaration_final_simpleType_initialized() { | |
161 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("final A a = 0;"))
; | |
162 } | |
163 void test_isInitializedVariableDeclaration_functionDeclaration_typed() { | |
164 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("A f() {};")); | |
165 } | |
166 void test_isInitializedVariableDeclaration_functionDeclaration_untyped() { | |
167 JUnitTestCase.assertFalse(isInitializedVariableDeclaration("f() {};")); | |
168 } | |
169 void test_isInitializedVariableDeclaration_noType_initialized() { | |
170 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("var a = 0;")); | |
171 } | |
172 void test_isInitializedVariableDeclaration_noType_uninitialized() { | |
173 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("var a;")); | |
174 } | |
175 void test_isInitializedVariableDeclaration_parameterizedType_initialized() { | |
176 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("List<int> a = nul
l;")); | |
177 } | |
178 void test_isInitializedVariableDeclaration_parameterizedType_uninitialized() { | |
179 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("List<int> a;")); | |
180 } | |
181 void test_isInitializedVariableDeclaration_simpleType_initialized() { | |
182 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("A a = 0;")); | |
183 } | |
184 void test_isInitializedVariableDeclaration_simpleType_uninitialized() { | |
185 JUnitTestCase.assertTrue(isInitializedVariableDeclaration("A a;")); | |
186 } | |
187 void test_isSwitchMember_case_labeled() { | |
188 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: case")); | |
189 } | |
190 void test_isSwitchMember_case_unlabeled() { | |
191 JUnitTestCase.assertTrue(isSwitchMember("case")); | |
192 } | |
193 void test_isSwitchMember_default_labeled() { | |
194 JUnitTestCase.assertTrue(isSwitchMember("l1: l2: default")); | |
195 } | |
196 void test_isSwitchMember_default_unlabeled() { | |
197 JUnitTestCase.assertTrue(isSwitchMember("default")); | |
198 } | |
199 void test_isSwitchMember_false() { | |
200 JUnitTestCase.assertFalse(isSwitchMember("break;")); | |
201 } | |
202 void test_parseAdditiveExpression_normal() { | |
203 BinaryExpression expression = ParserTestCase.parse6("parseAdditiveExpression
", "x + y", []); | |
204 JUnitTestCase.assertNotNull(expression.leftOperand); | |
205 JUnitTestCase.assertNotNull(expression.operator); | |
206 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); | |
207 JUnitTestCase.assertNotNull(expression.rightOperand); | |
208 } | |
209 void test_parseAdditiveExpression_super() { | |
210 BinaryExpression expression = ParserTestCase.parse6("parseAdditiveExpression
", "super + y", []); | |
211 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | |
212 JUnitTestCase.assertNotNull(expression.operator); | |
213 JUnitTestCase.assertEquals(TokenType.PLUS, expression.operator.type); | |
214 JUnitTestCase.assertNotNull(expression.rightOperand); | |
215 } | |
216 void test_parseAnnotation_n1() { | |
217 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A", []); | |
218 JUnitTestCase.assertNotNull(annotation.atSign); | |
219 JUnitTestCase.assertNotNull(annotation.name); | |
220 JUnitTestCase.assertNull(annotation.period); | |
221 JUnitTestCase.assertNull(annotation.constructorName); | |
222 JUnitTestCase.assertNull(annotation.arguments); | |
223 } | |
224 void test_parseAnnotation_n1_a() { | |
225 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A(x,y)",
[]); | |
226 JUnitTestCase.assertNotNull(annotation.atSign); | |
227 JUnitTestCase.assertNotNull(annotation.name); | |
228 JUnitTestCase.assertNull(annotation.period); | |
229 JUnitTestCase.assertNull(annotation.constructorName); | |
230 JUnitTestCase.assertNotNull(annotation.arguments); | |
231 } | |
232 void test_parseAnnotation_n2() { | |
233 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B", [])
; | |
234 JUnitTestCase.assertNotNull(annotation.atSign); | |
235 JUnitTestCase.assertNotNull(annotation.name); | |
236 JUnitTestCase.assertNull(annotation.period); | |
237 JUnitTestCase.assertNull(annotation.constructorName); | |
238 JUnitTestCase.assertNull(annotation.arguments); | |
239 } | |
240 void test_parseAnnotation_n2_a() { | |
241 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B(x,y)"
, []); | |
242 JUnitTestCase.assertNotNull(annotation.atSign); | |
243 JUnitTestCase.assertNotNull(annotation.name); | |
244 JUnitTestCase.assertNull(annotation.period); | |
245 JUnitTestCase.assertNull(annotation.constructorName); | |
246 JUnitTestCase.assertNotNull(annotation.arguments); | |
247 } | |
248 void test_parseAnnotation_n3() { | |
249 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B.C", [
]); | |
250 JUnitTestCase.assertNotNull(annotation.atSign); | |
251 JUnitTestCase.assertNotNull(annotation.name); | |
252 JUnitTestCase.assertNotNull(annotation.period); | |
253 JUnitTestCase.assertNotNull(annotation.constructorName); | |
254 JUnitTestCase.assertNull(annotation.arguments); | |
255 } | |
256 void test_parseAnnotation_n3_a() { | |
257 Annotation annotation = ParserTestCase.parse6("parseAnnotation", "@A.B.C(x,y
)", []); | |
258 JUnitTestCase.assertNotNull(annotation.atSign); | |
259 JUnitTestCase.assertNotNull(annotation.name); | |
260 JUnitTestCase.assertNotNull(annotation.period); | |
261 JUnitTestCase.assertNotNull(annotation.constructorName); | |
262 JUnitTestCase.assertNotNull(annotation.arguments); | |
263 } | |
264 void test_parseArgument_named() { | |
265 NamedExpression expression = ParserTestCase.parse6("parseArgument", "n: x",
[]); | |
266 Label name22 = expression.name; | |
267 JUnitTestCase.assertNotNull(name22); | |
268 JUnitTestCase.assertNotNull(name22.label); | |
269 JUnitTestCase.assertNotNull(name22.colon); | |
270 JUnitTestCase.assertNotNull(expression.expression); | |
271 } | |
272 void test_parseArgument_unnamed() { | |
273 String lexeme = "x"; | |
274 SimpleIdentifier identifier = ParserTestCase.parse6("parseArgument", lexeme,
[]); | |
275 JUnitTestCase.assertEquals(lexeme, identifier.name); | |
276 } | |
277 void test_parseArgumentDefinitionTest() { | |
278 ArgumentDefinitionTest test = ParserTestCase.parse6("parseArgumentDefinition
Test", "?x", []); | |
279 JUnitTestCase.assertNotNull(test.question); | |
280 JUnitTestCase.assertNotNull(test.identifier); | |
281 } | |
282 void test_parseArgumentList_empty() { | |
283 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "()",
[]); | |
284 NodeList<Expression> arguments7 = argumentList.arguments; | |
285 EngineTestCase.assertSize(0, arguments7); | |
286 } | |
287 void test_parseArgumentList_mixed() { | |
288 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(w,
x, y: y, z: z)", []); | |
289 NodeList<Expression> arguments8 = argumentList.arguments; | |
290 EngineTestCase.assertSize(4, arguments8); | |
291 } | |
292 void test_parseArgumentList_noNamed() { | |
293 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(x,
y, z)", []); | |
294 NodeList<Expression> arguments9 = argumentList.arguments; | |
295 EngineTestCase.assertSize(3, arguments9); | |
296 } | |
297 void test_parseArgumentList_onlyNamed() { | |
298 ArgumentList argumentList = ParserTestCase.parse6("parseArgumentList", "(x:
x, y: y)", []); | |
299 NodeList<Expression> arguments10 = argumentList.arguments; | |
300 EngineTestCase.assertSize(2, arguments10); | |
301 } | |
302 void test_parseAssertStatement() { | |
303 AssertStatement statement = ParserTestCase.parse6("parseAssertStatement", "a
ssert (x);", []); | |
304 JUnitTestCase.assertNotNull(statement.keyword); | |
305 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
306 JUnitTestCase.assertNotNull(statement.condition); | |
307 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
308 JUnitTestCase.assertNotNull(statement.semicolon); | |
309 } | |
310 void test_parseAssignableExpression_expression_args_dot() { | |
311 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x)(y).z"); | |
312 FunctionExpressionInvocation invocation = propertyAccess.target as FunctionE
xpressionInvocation; | |
313 JUnitTestCase.assertNotNull(invocation.function); | |
314 ArgumentList argumentList12 = invocation.argumentList; | |
315 JUnitTestCase.assertNotNull(argumentList12); | |
316 EngineTestCase.assertSize(1, argumentList12.arguments); | |
317 JUnitTestCase.assertNotNull(propertyAccess.operator); | |
318 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | |
319 } | |
320 void test_parseAssignableExpression_expression_dot() { | |
321 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "(x).y"); | |
322 JUnitTestCase.assertNotNull(propertyAccess.target); | |
323 JUnitTestCase.assertNotNull(propertyAccess.operator); | |
324 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | |
325 } | |
326 void test_parseAssignableExpression_expression_index() { | |
327 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression
", <Object> [false], "(x)[y]"); | |
328 JUnitTestCase.assertNotNull(expression.array); | |
329 JUnitTestCase.assertNotNull(expression.leftBracket); | |
330 JUnitTestCase.assertNotNull(expression.index); | |
331 JUnitTestCase.assertNotNull(expression.rightBracket); | |
332 } | |
333 void test_parseAssignableExpression_identifier() { | |
334 SimpleIdentifier identifier = ParserTestCase.parse("parseAssignableExpressio
n", <Object> [false], "x"); | |
335 JUnitTestCase.assertNotNull(identifier); | |
336 } | |
337 void test_parseAssignableExpression_identifier_args_dot() { | |
338 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x(y).z"); | |
339 MethodInvocation invocation = propertyAccess.target as MethodInvocation; | |
340 JUnitTestCase.assertEquals("x", invocation.methodName.name); | |
341 ArgumentList argumentList13 = invocation.argumentList; | |
342 JUnitTestCase.assertNotNull(argumentList13); | |
343 EngineTestCase.assertSize(1, argumentList13.arguments); | |
344 JUnitTestCase.assertNotNull(propertyAccess.operator); | |
345 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | |
346 } | |
347 void test_parseAssignableExpression_identifier_dot() { | |
348 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "x.y"); | |
349 JUnitTestCase.assertNotNull(propertyAccess.target); | |
350 JUnitTestCase.assertNotNull(propertyAccess.operator); | |
351 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | |
352 } | |
353 void test_parseAssignableExpression_identifier_index() { | |
354 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression
", <Object> [false], "x[y]"); | |
355 JUnitTestCase.assertNotNull(expression.array); | |
356 JUnitTestCase.assertNotNull(expression.leftBracket); | |
357 JUnitTestCase.assertNotNull(expression.index); | |
358 JUnitTestCase.assertNotNull(expression.rightBracket); | |
359 } | |
360 void test_parseAssignableExpression_super_dot() { | |
361 PropertyAccess propertyAccess = ParserTestCase.parse("parseAssignableExpress
ion", <Object> [false], "super.y"); | |
362 EngineTestCase.assertInstanceOf(SuperExpression, propertyAccess.target); | |
363 JUnitTestCase.assertNotNull(propertyAccess.operator); | |
364 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | |
365 } | |
366 void test_parseAssignableExpression_super_index() { | |
367 IndexExpression expression = ParserTestCase.parse("parseAssignableExpression
", <Object> [false], "super[y]"); | |
368 EngineTestCase.assertInstanceOf(SuperExpression, expression.array); | |
369 JUnitTestCase.assertNotNull(expression.leftBracket); | |
370 JUnitTestCase.assertNotNull(expression.index); | |
371 JUnitTestCase.assertNotNull(expression.rightBracket); | |
372 } | |
373 void test_parseAssignableSelector_dot() { | |
374 PropertyAccess selector = ParserTestCase.parse("parseAssignableSelector", <O
bject> [null, true], ".x"); | |
375 JUnitTestCase.assertNotNull(selector.operator); | |
376 JUnitTestCase.assertNotNull(selector.propertyName); | |
377 } | |
378 void test_parseAssignableSelector_index() { | |
379 IndexExpression selector = ParserTestCase.parse("parseAssignableSelector", <
Object> [null, true], "[x]"); | |
380 JUnitTestCase.assertNotNull(selector.leftBracket); | |
381 JUnitTestCase.assertNotNull(selector.index); | |
382 JUnitTestCase.assertNotNull(selector.rightBracket); | |
383 } | |
384 void test_parseAssignableSelector_none() { | |
385 SimpleIdentifier selector = ParserTestCase.parse("parseAssignableSelector",
<Object> [new SimpleIdentifier.full(null), true], ";"); | |
386 JUnitTestCase.assertNotNull(selector); | |
387 } | |
388 void test_parseBitwiseAndExpression_normal() { | |
389 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseAndExpressi
on", "x & y", []); | |
390 JUnitTestCase.assertNotNull(expression.leftOperand); | |
391 JUnitTestCase.assertNotNull(expression.operator); | |
392 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); | |
393 JUnitTestCase.assertNotNull(expression.rightOperand); | |
394 } | |
395 void test_parseBitwiseAndExpression_super() { | |
396 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseAndExpressi
on", "super & y", []); | |
397 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | |
398 JUnitTestCase.assertNotNull(expression.operator); | |
399 JUnitTestCase.assertEquals(TokenType.AMPERSAND, expression.operator.type); | |
400 JUnitTestCase.assertNotNull(expression.rightOperand); | |
401 } | |
402 void test_parseBitwiseOrExpression_normal() { | |
403 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseOrExpressio
n", "x | y", []); | |
404 JUnitTestCase.assertNotNull(expression.leftOperand); | |
405 JUnitTestCase.assertNotNull(expression.operator); | |
406 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); | |
407 JUnitTestCase.assertNotNull(expression.rightOperand); | |
408 } | |
409 void test_parseBitwiseOrExpression_super() { | |
410 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseOrExpressio
n", "super | y", []); | |
411 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | |
412 JUnitTestCase.assertNotNull(expression.operator); | |
413 JUnitTestCase.assertEquals(TokenType.BAR, expression.operator.type); | |
414 JUnitTestCase.assertNotNull(expression.rightOperand); | |
415 } | |
416 void test_parseBitwiseXorExpression_normal() { | |
417 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseXorExpressi
on", "x ^ y", []); | |
418 JUnitTestCase.assertNotNull(expression.leftOperand); | |
419 JUnitTestCase.assertNotNull(expression.operator); | |
420 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); | |
421 JUnitTestCase.assertNotNull(expression.rightOperand); | |
422 } | |
423 void test_parseBitwiseXorExpression_super() { | |
424 BinaryExpression expression = ParserTestCase.parse6("parseBitwiseXorExpressi
on", "super ^ y", []); | |
425 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | |
426 JUnitTestCase.assertNotNull(expression.operator); | |
427 JUnitTestCase.assertEquals(TokenType.CARET, expression.operator.type); | |
428 JUnitTestCase.assertNotNull(expression.rightOperand); | |
429 } | |
430 void test_parseBlock_empty() { | |
431 Block block = ParserTestCase.parse6("parseBlock", "{}", []); | |
432 JUnitTestCase.assertNotNull(block.leftBracket); | |
433 EngineTestCase.assertSize(0, block.statements); | |
434 JUnitTestCase.assertNotNull(block.rightBracket); | |
435 } | |
436 void test_parseBlock_nonEmpty() { | |
437 Block block = ParserTestCase.parse6("parseBlock", "{;}", []); | |
438 JUnitTestCase.assertNotNull(block.leftBracket); | |
439 EngineTestCase.assertSize(1, block.statements); | |
440 JUnitTestCase.assertNotNull(block.rightBracket); | |
441 } | |
442 void test_parseBreakStatement_label() { | |
443 BreakStatement statement = ParserTestCase.parse6("parseBreakStatement", "bre
ak foo;", []); | |
444 JUnitTestCase.assertNotNull(statement.keyword); | |
445 JUnitTestCase.assertNotNull(statement.label); | |
446 JUnitTestCase.assertNotNull(statement.semicolon); | |
447 } | |
448 void test_parseBreakStatement_noLabel() { | |
449 BreakStatement statement = ParserTestCase.parse6("parseBreakStatement", "bre
ak;", [ParserErrorCode.BREAK_OUTSIDE_OF_LOOP]); | |
450 JUnitTestCase.assertNotNull(statement.keyword); | |
451 JUnitTestCase.assertNull(statement.label); | |
452 JUnitTestCase.assertNotNull(statement.semicolon); | |
453 } | |
454 void test_parseCascadeSection_i() { | |
455 IndexExpression section = ParserTestCase.parse6("parseCascadeSection", "..[i
]", []); | |
456 JUnitTestCase.assertNull(section.array); | |
457 JUnitTestCase.assertNotNull(section.leftBracket); | |
458 JUnitTestCase.assertNotNull(section.index); | |
459 JUnitTestCase.assertNotNull(section.rightBracket); | |
460 } | |
461 void test_parseCascadeSection_ia() { | |
462 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe
ction", "..[i](b)", []); | |
463 EngineTestCase.assertInstanceOf(IndexExpression, section.function); | |
464 JUnitTestCase.assertNotNull(section.argumentList); | |
465 } | |
466 void test_parseCascadeSection_p() { | |
467 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..a",
[]); | |
468 JUnitTestCase.assertNull(section.target); | |
469 JUnitTestCase.assertNotNull(section.operator); | |
470 JUnitTestCase.assertNotNull(section.propertyName); | |
471 } | |
472 void test_parseCascadeSection_p_assign() { | |
473 AssignmentExpression section = ParserTestCase.parse6("parseCascadeSection",
"..a = 3", []); | |
474 JUnitTestCase.assertNotNull(section.leftHandSide); | |
475 JUnitTestCase.assertNotNull(section.operator); | |
476 Expression rhs = section.rightHandSide; | |
477 JUnitTestCase.assertNotNull(rhs); | |
478 } | |
479 void test_parseCascadeSection_p_assign_withCascade() { | |
480 AssignmentExpression section = ParserTestCase.parse6("parseCascadeSection",
"..a = 3..m()", []); | |
481 JUnitTestCase.assertNotNull(section.leftHandSide); | |
482 JUnitTestCase.assertNotNull(section.operator); | |
483 Expression rhs = section.rightHandSide; | |
484 EngineTestCase.assertInstanceOf(IntegerLiteral, rhs); | |
485 } | |
486 void test_parseCascadeSection_p_builtIn() { | |
487 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..as"
, []); | |
488 JUnitTestCase.assertNull(section.target); | |
489 JUnitTestCase.assertNotNull(section.operator); | |
490 JUnitTestCase.assertNotNull(section.propertyName); | |
491 } | |
492 void test_parseCascadeSection_pa() { | |
493 MethodInvocation section = ParserTestCase.parse6("parseCascadeSection", "..a
(b)", []); | |
494 JUnitTestCase.assertNull(section.target); | |
495 JUnitTestCase.assertNotNull(section.period); | |
496 JUnitTestCase.assertNotNull(section.methodName); | |
497 JUnitTestCase.assertNotNull(section.argumentList); | |
498 EngineTestCase.assertSize(1, section.argumentList.arguments); | |
499 } | |
500 void test_parseCascadeSection_paa() { | |
501 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe
ction", "..a(b)(c)", []); | |
502 EngineTestCase.assertInstanceOf(MethodInvocation, section.function); | |
503 JUnitTestCase.assertNotNull(section.argumentList); | |
504 EngineTestCase.assertSize(1, section.argumentList.arguments); | |
505 } | |
506 void test_parseCascadeSection_paapaa() { | |
507 FunctionExpressionInvocation section = ParserTestCase.parse6("parseCascadeSe
ction", "..a(b)(c).d(e)(f)", []); | |
508 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, section.functi
on); | |
509 JUnitTestCase.assertNotNull(section.argumentList); | |
510 EngineTestCase.assertSize(1, section.argumentList.arguments); | |
511 } | |
512 void test_parseCascadeSection_pap() { | |
513 PropertyAccess section = ParserTestCase.parse6("parseCascadeSection", "..a(b
).c", []); | |
514 JUnitTestCase.assertNotNull(section.target); | |
515 JUnitTestCase.assertNotNull(section.operator); | |
516 JUnitTestCase.assertNotNull(section.propertyName); | |
517 } | |
518 void test_parseClassDeclaration_abstract() { | |
519 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), TokenFactory.token(Keyword.ABSTRACT)], "cl
ass A {}"); | |
520 JUnitTestCase.assertNull(declaration.documentationComment); | |
521 JUnitTestCase.assertNotNull(declaration.abstractKeyword); | |
522 JUnitTestCase.assertNull(declaration.extendsClause); | |
523 JUnitTestCase.assertNull(declaration.implementsClause); | |
524 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
525 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
526 JUnitTestCase.assertNotNull(declaration.name); | |
527 EngineTestCase.assertSize(0, declaration.members); | |
528 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
529 JUnitTestCase.assertNull(declaration.typeParameters); | |
530 } | |
531 void test_parseClassDeclaration_empty() { | |
532 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), null], "class A {}"); | |
533 JUnitTestCase.assertNull(declaration.documentationComment); | |
534 JUnitTestCase.assertNull(declaration.abstractKeyword); | |
535 JUnitTestCase.assertNull(declaration.extendsClause); | |
536 JUnitTestCase.assertNull(declaration.implementsClause); | |
537 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
538 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
539 JUnitTestCase.assertNotNull(declaration.name); | |
540 EngineTestCase.assertSize(0, declaration.members); | |
541 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
542 JUnitTestCase.assertNull(declaration.typeParameters); | |
543 } | |
544 void test_parseClassDeclaration_extends() { | |
545 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), null], "class A extends B {}"); | |
546 JUnitTestCase.assertNull(declaration.documentationComment); | |
547 JUnitTestCase.assertNull(declaration.abstractKeyword); | |
548 JUnitTestCase.assertNotNull(declaration.extendsClause); | |
549 JUnitTestCase.assertNull(declaration.implementsClause); | |
550 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
551 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
552 JUnitTestCase.assertNotNull(declaration.name); | |
553 EngineTestCase.assertSize(0, declaration.members); | |
554 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
555 JUnitTestCase.assertNull(declaration.typeParameters); | |
556 } | |
557 void test_parseClassDeclaration_extendsAndImplements() { | |
558 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), null], "class A extends B implements C {}"
); | |
559 JUnitTestCase.assertNull(declaration.documentationComment); | |
560 JUnitTestCase.assertNull(declaration.abstractKeyword); | |
561 JUnitTestCase.assertNotNull(declaration.extendsClause); | |
562 JUnitTestCase.assertNotNull(declaration.implementsClause); | |
563 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
564 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
565 JUnitTestCase.assertNotNull(declaration.name); | |
566 EngineTestCase.assertSize(0, declaration.members); | |
567 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
568 JUnitTestCase.assertNull(declaration.typeParameters); | |
569 } | |
570 void test_parseClassDeclaration_extendsAndWith() { | |
571 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), null], "class A extends B with C {}"); | |
572 JUnitTestCase.assertNull(declaration.documentationComment); | |
573 JUnitTestCase.assertNull(declaration.abstractKeyword); | |
574 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
575 JUnitTestCase.assertNotNull(declaration.name); | |
576 JUnitTestCase.assertNull(declaration.typeParameters); | |
577 JUnitTestCase.assertNotNull(declaration.extendsClause); | |
578 JUnitTestCase.assertNotNull(declaration.withClause); | |
579 JUnitTestCase.assertNull(declaration.implementsClause); | |
580 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
581 EngineTestCase.assertSize(0, declaration.members); | |
582 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
583 } | |
584 void test_parseClassDeclaration_extendsAndWithAndImplements() { | |
585 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), null], "class A extends B with C implement
s D {}"); | |
586 JUnitTestCase.assertNull(declaration.documentationComment); | |
587 JUnitTestCase.assertNull(declaration.abstractKeyword); | |
588 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
589 JUnitTestCase.assertNotNull(declaration.name); | |
590 JUnitTestCase.assertNull(declaration.typeParameters); | |
591 JUnitTestCase.assertNotNull(declaration.extendsClause); | |
592 JUnitTestCase.assertNotNull(declaration.withClause); | |
593 JUnitTestCase.assertNotNull(declaration.implementsClause); | |
594 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
595 EngineTestCase.assertSize(0, declaration.members); | |
596 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
597 } | |
598 void test_parseClassDeclaration_implements() { | |
599 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), null], "class A implements C {}"); | |
600 JUnitTestCase.assertNull(declaration.documentationComment); | |
601 JUnitTestCase.assertNull(declaration.abstractKeyword); | |
602 JUnitTestCase.assertNull(declaration.extendsClause); | |
603 JUnitTestCase.assertNotNull(declaration.implementsClause); | |
604 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
605 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
606 JUnitTestCase.assertNotNull(declaration.name); | |
607 EngineTestCase.assertSize(0, declaration.members); | |
608 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
609 JUnitTestCase.assertNull(declaration.typeParameters); | |
610 } | |
611 void test_parseClassDeclaration_nonEmpty() { | |
612 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), null], "class A {var f;}"); | |
613 JUnitTestCase.assertNull(declaration.documentationComment); | |
614 JUnitTestCase.assertNull(declaration.abstractKeyword); | |
615 JUnitTestCase.assertNull(declaration.extendsClause); | |
616 JUnitTestCase.assertNull(declaration.implementsClause); | |
617 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
618 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
619 JUnitTestCase.assertNotNull(declaration.name); | |
620 EngineTestCase.assertSize(1, declaration.members); | |
621 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
622 JUnitTestCase.assertNull(declaration.typeParameters); | |
623 } | |
624 void test_parseClassDeclaration_typeParameters() { | |
625 ClassDeclaration declaration = ParserTestCase.parse("parseClassDeclaration",
<Object> [emptyCommentAndMetadata(), null], "class A<B> {}"); | |
626 JUnitTestCase.assertNull(declaration.documentationComment); | |
627 JUnitTestCase.assertNull(declaration.abstractKeyword); | |
628 JUnitTestCase.assertNull(declaration.extendsClause); | |
629 JUnitTestCase.assertNull(declaration.implementsClause); | |
630 JUnitTestCase.assertNotNull(declaration.classKeyword); | |
631 JUnitTestCase.assertNotNull(declaration.leftBracket); | |
632 JUnitTestCase.assertNotNull(declaration.name); | |
633 EngineTestCase.assertSize(0, declaration.members); | |
634 JUnitTestCase.assertNotNull(declaration.rightBracket); | |
635 JUnitTestCase.assertNotNull(declaration.typeParameters); | |
636 EngineTestCase.assertSize(1, declaration.typeParameters.typeParameters); | |
637 } | |
638 void test_parseClassMember_constructor_withInitializers() { | |
639 ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember"
, <Object> ["C"], "C(_, _\$, this.__) : _a = _ + _\$ {}"); | |
640 JUnitTestCase.assertNotNull(constructor.body); | |
641 JUnitTestCase.assertNotNull(constructor.separator); | |
642 JUnitTestCase.assertNull(constructor.externalKeyword); | |
643 JUnitTestCase.assertNull(constructor.constKeyword); | |
644 JUnitTestCase.assertNull(constructor.factoryKeyword); | |
645 JUnitTestCase.assertNull(constructor.name); | |
646 JUnitTestCase.assertNotNull(constructor.parameters); | |
647 JUnitTestCase.assertNull(constructor.period); | |
648 JUnitTestCase.assertNotNull(constructor.returnType); | |
649 EngineTestCase.assertSize(1, constructor.initializers); | |
650 } | |
651 void test_parseClassMember_field_instance_prefixedType() { | |
652 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "p.A f;"); | |
653 JUnitTestCase.assertNull(field.documentationComment); | |
654 EngineTestCase.assertSize(0, field.metadata); | |
655 JUnitTestCase.assertNull(field.keyword); | |
656 VariableDeclarationList list = field.fields; | |
657 JUnitTestCase.assertNotNull(list); | |
658 NodeList<VariableDeclaration> variables4 = list.variables; | |
659 EngineTestCase.assertSize(1, variables4); | |
660 VariableDeclaration variable = variables4[0]; | |
661 JUnitTestCase.assertNotNull(variable.name); | |
662 } | |
663 void test_parseClassMember_field_namedGet() { | |
664 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var get;"); | |
665 JUnitTestCase.assertNull(field.documentationComment); | |
666 EngineTestCase.assertSize(0, field.metadata); | |
667 JUnitTestCase.assertNull(field.keyword); | |
668 VariableDeclarationList list = field.fields; | |
669 JUnitTestCase.assertNotNull(list); | |
670 NodeList<VariableDeclaration> variables5 = list.variables; | |
671 EngineTestCase.assertSize(1, variables5); | |
672 VariableDeclaration variable = variables5[0]; | |
673 JUnitTestCase.assertNotNull(variable.name); | |
674 } | |
675 void test_parseClassMember_field_namedOperator() { | |
676 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var operator;"); | |
677 JUnitTestCase.assertNull(field.documentationComment); | |
678 EngineTestCase.assertSize(0, field.metadata); | |
679 JUnitTestCase.assertNull(field.keyword); | |
680 VariableDeclarationList list = field.fields; | |
681 JUnitTestCase.assertNotNull(list); | |
682 NodeList<VariableDeclaration> variables6 = list.variables; | |
683 EngineTestCase.assertSize(1, variables6); | |
684 VariableDeclaration variable = variables6[0]; | |
685 JUnitTestCase.assertNotNull(variable.name); | |
686 } | |
687 void test_parseClassMember_field_namedSet() { | |
688 FieldDeclaration field = ParserTestCase.parse("parseClassMember", <Object> [
"C"], "var set;"); | |
689 JUnitTestCase.assertNull(field.documentationComment); | |
690 EngineTestCase.assertSize(0, field.metadata); | |
691 JUnitTestCase.assertNull(field.keyword); | |
692 VariableDeclarationList list = field.fields; | |
693 JUnitTestCase.assertNotNull(list); | |
694 NodeList<VariableDeclaration> variables7 = list.variables; | |
695 EngineTestCase.assertSize(1, variables7); | |
696 VariableDeclaration variable = variables7[0]; | |
697 JUnitTestCase.assertNotNull(variable.name); | |
698 } | |
699 void test_parseClassMember_getter_void() { | |
700 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "void get g {}"); | |
701 JUnitTestCase.assertNull(method.documentationComment); | |
702 JUnitTestCase.assertNull(method.externalKeyword); | |
703 JUnitTestCase.assertNull(method.modifierKeyword); | |
704 JUnitTestCase.assertNotNull(method.propertyKeyword); | |
705 JUnitTestCase.assertNotNull(method.returnType); | |
706 JUnitTestCase.assertNotNull(method.name); | |
707 JUnitTestCase.assertNull(method.operatorKeyword); | |
708 JUnitTestCase.assertNotNull(method.body); | |
709 } | |
710 void test_parseClassMember_method_external() { | |
711 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "external m();"); | |
712 JUnitTestCase.assertNotNull(method.body); | |
713 JUnitTestCase.assertNull(method.documentationComment); | |
714 JUnitTestCase.assertNotNull(method.externalKeyword); | |
715 JUnitTestCase.assertNull(method.modifierKeyword); | |
716 JUnitTestCase.assertNotNull(method.name); | |
717 JUnitTestCase.assertNull(method.operatorKeyword); | |
718 JUnitTestCase.assertNotNull(method.parameters); | |
719 JUnitTestCase.assertNull(method.propertyKeyword); | |
720 JUnitTestCase.assertNull(method.returnType); | |
721 } | |
722 void test_parseClassMember_method_external_withTypeAndArgs() { | |
723 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "external int m(int a);"); | |
724 JUnitTestCase.assertNotNull(method.body); | |
725 JUnitTestCase.assertNull(method.documentationComment); | |
726 JUnitTestCase.assertNotNull(method.externalKeyword); | |
727 JUnitTestCase.assertNull(method.modifierKeyword); | |
728 JUnitTestCase.assertNotNull(method.name); | |
729 JUnitTestCase.assertNull(method.operatorKeyword); | |
730 JUnitTestCase.assertNotNull(method.parameters); | |
731 JUnitTestCase.assertNull(method.propertyKeyword); | |
732 JUnitTestCase.assertNotNull(method.returnType); | |
733 } | |
734 void test_parseClassMember_method_get_noType() { | |
735 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "get() {}"); | |
736 JUnitTestCase.assertNull(method.documentationComment); | |
737 JUnitTestCase.assertNull(method.externalKeyword); | |
738 JUnitTestCase.assertNull(method.modifierKeyword); | |
739 JUnitTestCase.assertNull(method.propertyKeyword); | |
740 JUnitTestCase.assertNull(method.returnType); | |
741 JUnitTestCase.assertNotNull(method.name); | |
742 JUnitTestCase.assertNull(method.operatorKeyword); | |
743 JUnitTestCase.assertNotNull(method.parameters); | |
744 JUnitTestCase.assertNotNull(method.body); | |
745 } | |
746 void test_parseClassMember_method_get_type() { | |
747 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "int get() {}"); | |
748 JUnitTestCase.assertNull(method.documentationComment); | |
749 JUnitTestCase.assertNull(method.externalKeyword); | |
750 JUnitTestCase.assertNull(method.modifierKeyword); | |
751 JUnitTestCase.assertNull(method.propertyKeyword); | |
752 JUnitTestCase.assertNotNull(method.returnType); | |
753 JUnitTestCase.assertNotNull(method.name); | |
754 JUnitTestCase.assertNull(method.operatorKeyword); | |
755 JUnitTestCase.assertNotNull(method.parameters); | |
756 JUnitTestCase.assertNotNull(method.body); | |
757 } | |
758 void test_parseClassMember_method_get_void() { | |
759 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "void get() {}"); | |
760 JUnitTestCase.assertNull(method.documentationComment); | |
761 JUnitTestCase.assertNull(method.externalKeyword); | |
762 JUnitTestCase.assertNull(method.modifierKeyword); | |
763 JUnitTestCase.assertNull(method.propertyKeyword); | |
764 JUnitTestCase.assertNotNull(method.returnType); | |
765 JUnitTestCase.assertNotNull(method.name); | |
766 JUnitTestCase.assertNull(method.operatorKeyword); | |
767 JUnitTestCase.assertNotNull(method.parameters); | |
768 JUnitTestCase.assertNotNull(method.body); | |
769 } | |
770 void test_parseClassMember_method_operator_noType() { | |
771 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "operator() {}"); | |
772 JUnitTestCase.assertNull(method.documentationComment); | |
773 JUnitTestCase.assertNull(method.externalKeyword); | |
774 JUnitTestCase.assertNull(method.modifierKeyword); | |
775 JUnitTestCase.assertNull(method.propertyKeyword); | |
776 JUnitTestCase.assertNull(method.returnType); | |
777 JUnitTestCase.assertNotNull(method.name); | |
778 JUnitTestCase.assertNull(method.operatorKeyword); | |
779 JUnitTestCase.assertNotNull(method.parameters); | |
780 JUnitTestCase.assertNotNull(method.body); | |
781 } | |
782 void test_parseClassMember_method_operator_type() { | |
783 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "int operator() {}"); | |
784 JUnitTestCase.assertNull(method.documentationComment); | |
785 JUnitTestCase.assertNull(method.externalKeyword); | |
786 JUnitTestCase.assertNull(method.modifierKeyword); | |
787 JUnitTestCase.assertNull(method.propertyKeyword); | |
788 JUnitTestCase.assertNotNull(method.returnType); | |
789 JUnitTestCase.assertNotNull(method.name); | |
790 JUnitTestCase.assertNull(method.operatorKeyword); | |
791 JUnitTestCase.assertNotNull(method.parameters); | |
792 JUnitTestCase.assertNotNull(method.body); | |
793 } | |
794 void test_parseClassMember_method_operator_void() { | |
795 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "void operator() {}"); | |
796 JUnitTestCase.assertNull(method.documentationComment); | |
797 JUnitTestCase.assertNull(method.externalKeyword); | |
798 JUnitTestCase.assertNull(method.modifierKeyword); | |
799 JUnitTestCase.assertNull(method.propertyKeyword); | |
800 JUnitTestCase.assertNotNull(method.returnType); | |
801 JUnitTestCase.assertNotNull(method.name); | |
802 JUnitTestCase.assertNull(method.operatorKeyword); | |
803 JUnitTestCase.assertNotNull(method.parameters); | |
804 JUnitTestCase.assertNotNull(method.body); | |
805 } | |
806 void test_parseClassMember_method_returnType_parameterized() { | |
807 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "p.A m() {}"); | |
808 JUnitTestCase.assertNull(method.documentationComment); | |
809 JUnitTestCase.assertNull(method.externalKeyword); | |
810 JUnitTestCase.assertNull(method.modifierKeyword); | |
811 JUnitTestCase.assertNull(method.propertyKeyword); | |
812 JUnitTestCase.assertNotNull(method.returnType); | |
813 JUnitTestCase.assertNotNull(method.name); | |
814 JUnitTestCase.assertNull(method.operatorKeyword); | |
815 JUnitTestCase.assertNotNull(method.parameters); | |
816 JUnitTestCase.assertNotNull(method.body); | |
817 } | |
818 void test_parseClassMember_method_set_noType() { | |
819 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "set() {}"); | |
820 JUnitTestCase.assertNull(method.documentationComment); | |
821 JUnitTestCase.assertNull(method.externalKeyword); | |
822 JUnitTestCase.assertNull(method.modifierKeyword); | |
823 JUnitTestCase.assertNull(method.propertyKeyword); | |
824 JUnitTestCase.assertNull(method.returnType); | |
825 JUnitTestCase.assertNotNull(method.name); | |
826 JUnitTestCase.assertNull(method.operatorKeyword); | |
827 JUnitTestCase.assertNotNull(method.parameters); | |
828 JUnitTestCase.assertNotNull(method.body); | |
829 } | |
830 void test_parseClassMember_method_set_type() { | |
831 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "int set() {}"); | |
832 JUnitTestCase.assertNull(method.documentationComment); | |
833 JUnitTestCase.assertNull(method.externalKeyword); | |
834 JUnitTestCase.assertNull(method.modifierKeyword); | |
835 JUnitTestCase.assertNull(method.propertyKeyword); | |
836 JUnitTestCase.assertNotNull(method.returnType); | |
837 JUnitTestCase.assertNotNull(method.name); | |
838 JUnitTestCase.assertNull(method.operatorKeyword); | |
839 JUnitTestCase.assertNotNull(method.parameters); | |
840 JUnitTestCase.assertNotNull(method.body); | |
841 } | |
842 void test_parseClassMember_method_set_void() { | |
843 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "void set() {}"); | |
844 JUnitTestCase.assertNull(method.documentationComment); | |
845 JUnitTestCase.assertNull(method.externalKeyword); | |
846 JUnitTestCase.assertNull(method.modifierKeyword); | |
847 JUnitTestCase.assertNull(method.propertyKeyword); | |
848 JUnitTestCase.assertNotNull(method.returnType); | |
849 JUnitTestCase.assertNotNull(method.name); | |
850 JUnitTestCase.assertNull(method.operatorKeyword); | |
851 JUnitTestCase.assertNotNull(method.parameters); | |
852 JUnitTestCase.assertNotNull(method.body); | |
853 } | |
854 void test_parseClassMember_operator_index() { | |
855 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "int operator [](int i) {}"); | |
856 JUnitTestCase.assertNull(method.documentationComment); | |
857 JUnitTestCase.assertNull(method.externalKeyword); | |
858 JUnitTestCase.assertNull(method.modifierKeyword); | |
859 JUnitTestCase.assertNull(method.propertyKeyword); | |
860 JUnitTestCase.assertNotNull(method.returnType); | |
861 JUnitTestCase.assertNotNull(method.name); | |
862 JUnitTestCase.assertNotNull(method.operatorKeyword); | |
863 JUnitTestCase.assertNotNull(method.parameters); | |
864 JUnitTestCase.assertNotNull(method.body); | |
865 } | |
866 void test_parseClassMember_operator_indexAssign() { | |
867 MethodDeclaration method = ParserTestCase.parse("parseClassMember", <Object>
["C"], "int operator []=(int i) {}"); | |
868 JUnitTestCase.assertNull(method.documentationComment); | |
869 JUnitTestCase.assertNull(method.externalKeyword); | |
870 JUnitTestCase.assertNull(method.modifierKeyword); | |
871 JUnitTestCase.assertNull(method.propertyKeyword); | |
872 JUnitTestCase.assertNotNull(method.returnType); | |
873 JUnitTestCase.assertNotNull(method.name); | |
874 JUnitTestCase.assertNotNull(method.operatorKeyword); | |
875 JUnitTestCase.assertNotNull(method.parameters); | |
876 JUnitTestCase.assertNotNull(method.body); | |
877 } | |
878 void test_parseClassMember_redirectingFactory_const() { | |
879 ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember"
, <Object> ["C"], "const factory C() = B;"); | |
880 JUnitTestCase.assertNull(constructor.externalKeyword); | |
881 JUnitTestCase.assertNotNull(constructor.constKeyword); | |
882 JUnitTestCase.assertNotNull(constructor.factoryKeyword); | |
883 JUnitTestCase.assertNotNull(constructor.returnType); | |
884 JUnitTestCase.assertNull(constructor.period); | |
885 JUnitTestCase.assertNull(constructor.name); | |
886 JUnitTestCase.assertNotNull(constructor.parameters); | |
887 JUnitTestCase.assertNotNull(constructor.separator); | |
888 EngineTestCase.assertSize(0, constructor.initializers); | |
889 JUnitTestCase.assertNotNull(constructor.redirectedConstructor); | |
890 JUnitTestCase.assertNotNull(constructor.body); | |
891 } | |
892 void test_parseClassMember_redirectingFactory_nonConst() { | |
893 ConstructorDeclaration constructor = ParserTestCase.parse("parseClassMember"
, <Object> ["C"], "factory C() = B;"); | |
894 JUnitTestCase.assertNull(constructor.externalKeyword); | |
895 JUnitTestCase.assertNull(constructor.constKeyword); | |
896 JUnitTestCase.assertNotNull(constructor.factoryKeyword); | |
897 JUnitTestCase.assertNotNull(constructor.returnType); | |
898 JUnitTestCase.assertNull(constructor.period); | |
899 JUnitTestCase.assertNull(constructor.name); | |
900 JUnitTestCase.assertNotNull(constructor.parameters); | |
901 JUnitTestCase.assertNotNull(constructor.separator); | |
902 EngineTestCase.assertSize(0, constructor.initializers); | |
903 JUnitTestCase.assertNotNull(constructor.redirectedConstructor); | |
904 JUnitTestCase.assertNotNull(constructor.body); | |
905 } | |
906 void test_parseCombinators_h() { | |
907 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi
de a;", []); | |
908 EngineTestCase.assertSize(1, combinators); | |
909 HideCombinator combinator = combinators[0] as HideCombinator; | |
910 JUnitTestCase.assertNotNull(combinator); | |
911 JUnitTestCase.assertNotNull(combinator.keyword); | |
912 EngineTestCase.assertSize(1, combinator.hiddenNames); | |
913 } | |
914 void test_parseCombinators_hs() { | |
915 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi
de a show b;", []); | |
916 EngineTestCase.assertSize(2, combinators); | |
917 HideCombinator hideCombinator = combinators[0] as HideCombinator; | |
918 JUnitTestCase.assertNotNull(hideCombinator); | |
919 JUnitTestCase.assertNotNull(hideCombinator.keyword); | |
920 EngineTestCase.assertSize(1, hideCombinator.hiddenNames); | |
921 ShowCombinator showCombinator = combinators[1] as ShowCombinator; | |
922 JUnitTestCase.assertNotNull(showCombinator); | |
923 JUnitTestCase.assertNotNull(showCombinator.keyword); | |
924 EngineTestCase.assertSize(1, showCombinator.shownNames); | |
925 } | |
926 void test_parseCombinators_hshs() { | |
927 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "hi
de a show b hide c show d;", []); | |
928 EngineTestCase.assertSize(4, combinators); | |
929 } | |
930 void test_parseCombinators_s() { | |
931 List<Combinator> combinators = ParserTestCase.parse6("parseCombinators", "sh
ow a;", []); | |
932 EngineTestCase.assertSize(1, combinators); | |
933 ShowCombinator combinator = combinators[0] as ShowCombinator; | |
934 JUnitTestCase.assertNotNull(combinator); | |
935 JUnitTestCase.assertNotNull(combinator.keyword); | |
936 EngineTestCase.assertSize(1, combinator.shownNames); | |
937 } | |
938 void test_parseCommentAndMetadata_c() { | |
939 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "/** 1 */ void", []); | |
940 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | |
941 EngineTestCase.assertSize(0, commentAndMetadata.metadata); | |
942 } | |
943 void test_parseCommentAndMetadata_cmc() { | |
944 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ void", []); | |
945 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | |
946 EngineTestCase.assertSize(1, commentAndMetadata.metadata); | |
947 } | |
948 void test_parseCommentAndMetadata_cmcm() { | |
949 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "/** 1 */ @A /** 2 */ @B void", []); | |
950 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | |
951 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | |
952 } | |
953 void test_parseCommentAndMetadata_cmm() { | |
954 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "/** 1 */ @A @B void", []); | |
955 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | |
956 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | |
957 } | |
958 void test_parseCommentAndMetadata_m() { | |
959 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "@A void", []); | |
960 JUnitTestCase.assertNull(commentAndMetadata.comment); | |
961 EngineTestCase.assertSize(1, commentAndMetadata.metadata); | |
962 } | |
963 void test_parseCommentAndMetadata_mcm() { | |
964 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "@A /** 1 */ @B void", []); | |
965 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | |
966 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | |
967 } | |
968 void test_parseCommentAndMetadata_mcmc() { | |
969 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "@A /** 1 */ @B /** 2 */ void", []); | |
970 JUnitTestCase.assertNotNull(commentAndMetadata.comment); | |
971 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | |
972 } | |
973 void test_parseCommentAndMetadata_mm() { | |
974 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "@A @B(x) void", []); | |
975 JUnitTestCase.assertNull(commentAndMetadata.comment); | |
976 EngineTestCase.assertSize(2, commentAndMetadata.metadata); | |
977 } | |
978 void test_parseCommentAndMetadata_none() { | |
979 CommentAndMetadata commentAndMetadata = ParserTestCase.parse6("parseCommentA
ndMetadata", "void", []); | |
980 JUnitTestCase.assertNull(commentAndMetadata.comment); | |
981 EngineTestCase.assertSize(0, commentAndMetadata.metadata); | |
982 } | |
983 void test_parseCommentReference_new_prefixed() { | |
984 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a.b", 7], ""); | |
985 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); | |
986 SimpleIdentifier prefix11 = prefixedIdentifier.prefix; | |
987 JUnitTestCase.assertNotNull(prefix11.token); | |
988 JUnitTestCase.assertEquals("a", prefix11.name); | |
989 JUnitTestCase.assertEquals(11, prefix11.offset); | |
990 JUnitTestCase.assertNotNull(prefixedIdentifier.period); | |
991 SimpleIdentifier identifier20 = prefixedIdentifier.identifier; | |
992 JUnitTestCase.assertNotNull(identifier20.token); | |
993 JUnitTestCase.assertEquals("b", identifier20.name); | |
994 JUnitTestCase.assertEquals(13, identifier20.offset); | |
995 } | |
996 void test_parseCommentReference_new_simple() { | |
997 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["new a", 5], ""); | |
998 SimpleIdentifier identifier21 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | |
999 JUnitTestCase.assertNotNull(identifier21.token); | |
1000 JUnitTestCase.assertEquals("a", identifier21.name); | |
1001 JUnitTestCase.assertEquals(9, identifier21.offset); | |
1002 } | |
1003 void test_parseCommentReference_prefixed() { | |
1004 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a.b", 7], ""); | |
1005 PrefixedIdentifier prefixedIdentifier = EngineTestCase.assertInstanceOf(Pref
ixedIdentifier, reference.identifier); | |
1006 SimpleIdentifier prefix12 = prefixedIdentifier.prefix; | |
1007 JUnitTestCase.assertNotNull(prefix12.token); | |
1008 JUnitTestCase.assertEquals("a", prefix12.name); | |
1009 JUnitTestCase.assertEquals(7, prefix12.offset); | |
1010 JUnitTestCase.assertNotNull(prefixedIdentifier.period); | |
1011 SimpleIdentifier identifier22 = prefixedIdentifier.identifier; | |
1012 JUnitTestCase.assertNotNull(identifier22.token); | |
1013 JUnitTestCase.assertEquals("b", identifier22.name); | |
1014 JUnitTestCase.assertEquals(9, identifier22.offset); | |
1015 } | |
1016 void test_parseCommentReference_simple() { | |
1017 CommentReference reference = ParserTestCase.parse("parseCommentReference", <
Object> ["a", 5], ""); | |
1018 SimpleIdentifier identifier23 = EngineTestCase.assertInstanceOf(SimpleIdenti
fier, reference.identifier); | |
1019 JUnitTestCase.assertNotNull(identifier23.token); | |
1020 JUnitTestCase.assertEquals("a", identifier23.name); | |
1021 JUnitTestCase.assertEquals(5, identifier23.offset); | |
1022 } | |
1023 void test_parseCommentReferences_multiLine() { | |
1024 List<Token> tokens = <Token> [new StringToken(TokenType.MULTI_LINE_COMMENT,
"/** xxx [a] yyy [b] zzz */", 3)]; | |
1025 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere
nces", <Object> [tokens], ""); | |
1026 EngineTestCase.assertSize(2, references); | |
1027 CommentReference reference = references[0]; | |
1028 JUnitTestCase.assertNotNull(reference); | |
1029 JUnitTestCase.assertNotNull(reference.identifier); | |
1030 JUnitTestCase.assertEquals(12, reference.offset); | |
1031 reference = references[1]; | |
1032 JUnitTestCase.assertNotNull(reference); | |
1033 JUnitTestCase.assertNotNull(reference.identifier); | |
1034 JUnitTestCase.assertEquals(20, reference.offset); | |
1035 } | |
1036 void test_parseCommentReferences_singleLine() { | |
1037 List<Token> tokens = <Token> [new StringToken(TokenType.SINGLE_LINE_COMMENT,
"/// xxx [a] yyy [b] zzz", 3), new StringToken(TokenType.SINGLE_LINE_COMMENT, "
/// x [c]", 28)]; | |
1038 List<CommentReference> references = ParserTestCase.parse("parseCommentRefere
nces", <Object> [tokens], ""); | |
1039 EngineTestCase.assertSize(3, references); | |
1040 CommentReference reference = references[0]; | |
1041 JUnitTestCase.assertNotNull(reference); | |
1042 JUnitTestCase.assertNotNull(reference.identifier); | |
1043 JUnitTestCase.assertEquals(12, reference.offset); | |
1044 reference = references[1]; | |
1045 JUnitTestCase.assertNotNull(reference); | |
1046 JUnitTestCase.assertNotNull(reference.identifier); | |
1047 JUnitTestCase.assertEquals(20, reference.offset); | |
1048 reference = references[2]; | |
1049 JUnitTestCase.assertNotNull(reference); | |
1050 JUnitTestCase.assertNotNull(reference.identifier); | |
1051 JUnitTestCase.assertEquals(35, reference.offset); | |
1052 } | |
1053 void test_parseCompilationUnit_abstractAsPrefix_parameterized() { | |
1054 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "abstra
ct<dynamic> _abstract = new abstract.A();", []); | |
1055 JUnitTestCase.assertNull(unit.scriptTag); | |
1056 EngineTestCase.assertSize(0, unit.directives); | |
1057 EngineTestCase.assertSize(1, unit.declarations); | |
1058 } | |
1059 void test_parseCompilationUnit_directives_multiple() { | |
1060 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y l;\npart 'a.dart';", []); | |
1061 JUnitTestCase.assertNull(unit.scriptTag); | |
1062 EngineTestCase.assertSize(2, unit.directives); | |
1063 EngineTestCase.assertSize(0, unit.declarations); | |
1064 } | |
1065 void test_parseCompilationUnit_directives_single() { | |
1066 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y l;", []); | |
1067 JUnitTestCase.assertNull(unit.scriptTag); | |
1068 EngineTestCase.assertSize(1, unit.directives); | |
1069 EngineTestCase.assertSize(0, unit.declarations); | |
1070 } | |
1071 void test_parseCompilationUnit_empty() { | |
1072 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "", [])
; | |
1073 JUnitTestCase.assertNull(unit.scriptTag); | |
1074 EngineTestCase.assertSize(0, unit.directives); | |
1075 EngineTestCase.assertSize(0, unit.declarations); | |
1076 } | |
1077 void test_parseCompilationUnit_exportAsPrefix() { | |
1078 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "export
.A _export = new export.A();", []); | |
1079 JUnitTestCase.assertNull(unit.scriptTag); | |
1080 EngineTestCase.assertSize(0, unit.directives); | |
1081 EngineTestCase.assertSize(1, unit.declarations); | |
1082 } | |
1083 void test_parseCompilationUnit_exportAsPrefix_parameterized() { | |
1084 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "export
<dynamic> _export = new export.A();", []); | |
1085 JUnitTestCase.assertNull(unit.scriptTag); | |
1086 EngineTestCase.assertSize(0, unit.directives); | |
1087 EngineTestCase.assertSize(1, unit.declarations); | |
1088 } | |
1089 void test_parseCompilationUnit_operatorAsPrefix_parameterized() { | |
1090 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "operat
or<dynamic> _operator = new operator.A();", []); | |
1091 JUnitTestCase.assertNull(unit.scriptTag); | |
1092 EngineTestCase.assertSize(0, unit.directives); | |
1093 EngineTestCase.assertSize(1, unit.declarations); | |
1094 } | |
1095 void test_parseCompilationUnit_script() { | |
1096 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "#! /bi
n/dart", []); | |
1097 JUnitTestCase.assertNotNull(unit.scriptTag); | |
1098 EngineTestCase.assertSize(0, unit.directives); | |
1099 EngineTestCase.assertSize(0, unit.declarations); | |
1100 } | |
1101 void test_parseCompilationUnit_topLevelDeclaration() { | |
1102 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "class
A {}", []); | |
1103 JUnitTestCase.assertNull(unit.scriptTag); | |
1104 EngineTestCase.assertSize(0, unit.directives); | |
1105 EngineTestCase.assertSize(1, unit.declarations); | |
1106 } | |
1107 void test_parseCompilationUnit_typedefAsPrefix() { | |
1108 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "typede
f.A _typedef = new typedef.A();", []); | |
1109 JUnitTestCase.assertNull(unit.scriptTag); | |
1110 EngineTestCase.assertSize(0, unit.directives); | |
1111 EngineTestCase.assertSize(1, unit.declarations); | |
1112 } | |
1113 void test_parseCompilationUnitMember_abstractAsPrefix() { | |
1114 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "abstract.A _abstract = n
ew abstract.A();"); | |
1115 JUnitTestCase.assertNotNull(declaration.semicolon); | |
1116 JUnitTestCase.assertNotNull(declaration.variables); | |
1117 } | |
1118 void test_parseCompilationUnitMember_class() { | |
1119 ClassDeclaration declaration = ParserTestCase.parse("parseCompilationUnitMem
ber", <Object> [emptyCommentAndMetadata()], "class A {}"); | |
1120 JUnitTestCase.assertEquals("A", declaration.name.name); | |
1121 EngineTestCase.assertSize(0, declaration.members); | |
1122 } | |
1123 void test_parseCompilationUnitMember_constVariable() { | |
1124 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "const int x = 0;"); | |
1125 JUnitTestCase.assertNotNull(declaration.semicolon); | |
1126 JUnitTestCase.assertNotNull(declaration.variables); | |
1127 } | |
1128 void test_parseCompilationUnitMember_finalVariable() { | |
1129 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "final x = 0;"); | |
1130 JUnitTestCase.assertNotNull(declaration.semicolon); | |
1131 JUnitTestCase.assertNotNull(declaration.variables); | |
1132 } | |
1133 void test_parseCompilationUnitMember_function_external_noType() { | |
1134 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external f();"); | |
1135 JUnitTestCase.assertNotNull(declaration.externalKeyword); | |
1136 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1137 JUnitTestCase.assertNull(declaration.propertyKeyword); | |
1138 } | |
1139 void test_parseCompilationUnitMember_function_external_type() { | |
1140 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external int f();"); | |
1141 JUnitTestCase.assertNotNull(declaration.externalKeyword); | |
1142 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1143 JUnitTestCase.assertNull(declaration.propertyKeyword); | |
1144 } | |
1145 void test_parseCompilationUnitMember_function_noType() { | |
1146 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "f() {}"); | |
1147 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1148 JUnitTestCase.assertNull(declaration.propertyKeyword); | |
1149 } | |
1150 void test_parseCompilationUnitMember_function_type() { | |
1151 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "int f() {}"); | |
1152 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1153 JUnitTestCase.assertNull(declaration.propertyKeyword); | |
1154 } | |
1155 void test_parseCompilationUnitMember_getter_external_noType() { | |
1156 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external get p;"); | |
1157 JUnitTestCase.assertNotNull(declaration.externalKeyword); | |
1158 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1159 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1160 } | |
1161 void test_parseCompilationUnitMember_getter_external_type() { | |
1162 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external int get p;"); | |
1163 JUnitTestCase.assertNotNull(declaration.externalKeyword); | |
1164 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1165 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1166 } | |
1167 void test_parseCompilationUnitMember_getter_noType() { | |
1168 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "get p => 0;"); | |
1169 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1170 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1171 } | |
1172 void test_parseCompilationUnitMember_getter_type() { | |
1173 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "int get p => 0;"); | |
1174 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1175 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1176 } | |
1177 void test_parseCompilationUnitMember_setter_external_noType() { | |
1178 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external set p(v);"); | |
1179 JUnitTestCase.assertNotNull(declaration.externalKeyword); | |
1180 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1181 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1182 } | |
1183 void test_parseCompilationUnitMember_setter_external_type() { | |
1184 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "external void set p(int v);"); | |
1185 JUnitTestCase.assertNotNull(declaration.externalKeyword); | |
1186 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1187 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1188 } | |
1189 void test_parseCompilationUnitMember_setter_noType() { | |
1190 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "set p(v) {}"); | |
1191 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1192 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1193 } | |
1194 void test_parseCompilationUnitMember_setter_type() { | |
1195 FunctionDeclaration declaration = ParserTestCase.parse("parseCompilationUnit
Member", <Object> [emptyCommentAndMetadata()], "void set p(int v) {}"); | |
1196 JUnitTestCase.assertNotNull(declaration.functionExpression); | |
1197 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1198 } | |
1199 void test_parseCompilationUnitMember_typedef_class_abstract() { | |
1200 ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember"
, <Object> [emptyCommentAndMetadata()], "typedef C = abstract S with M;"); | |
1201 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
1202 JUnitTestCase.assertEquals("C", typeAlias.name.name); | |
1203 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
1204 JUnitTestCase.assertNotNull(typeAlias.equals); | |
1205 JUnitTestCase.assertNotNull(typeAlias.abstractKeyword); | |
1206 JUnitTestCase.assertEquals("S", typeAlias.superclass.name.name); | |
1207 JUnitTestCase.assertNotNull(typeAlias.withClause); | |
1208 JUnitTestCase.assertNull(typeAlias.implementsClause); | |
1209 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
1210 } | |
1211 void test_parseCompilationUnitMember_typedef_class_generic() { | |
1212 ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember"
, <Object> [emptyCommentAndMetadata()], "typedef C<E> = S<E> with M<E> implement
s I<E>;"); | |
1213 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
1214 JUnitTestCase.assertEquals("C", typeAlias.name.name); | |
1215 EngineTestCase.assertSize(1, typeAlias.typeParameters.typeParameters); | |
1216 JUnitTestCase.assertNotNull(typeAlias.equals); | |
1217 JUnitTestCase.assertNull(typeAlias.abstractKeyword); | |
1218 JUnitTestCase.assertEquals("S", typeAlias.superclass.name.name); | |
1219 JUnitTestCase.assertNotNull(typeAlias.withClause); | |
1220 JUnitTestCase.assertNotNull(typeAlias.implementsClause); | |
1221 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
1222 } | |
1223 void test_parseCompilationUnitMember_typedef_class_implements() { | |
1224 ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember"
, <Object> [emptyCommentAndMetadata()], "typedef C = S with M implements I;"); | |
1225 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
1226 JUnitTestCase.assertEquals("C", typeAlias.name.name); | |
1227 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
1228 JUnitTestCase.assertNotNull(typeAlias.equals); | |
1229 JUnitTestCase.assertNull(typeAlias.abstractKeyword); | |
1230 JUnitTestCase.assertEquals("S", typeAlias.superclass.name.name); | |
1231 JUnitTestCase.assertNotNull(typeAlias.withClause); | |
1232 JUnitTestCase.assertNotNull(typeAlias.implementsClause); | |
1233 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
1234 } | |
1235 void test_parseCompilationUnitMember_typedef_class_noImplements() { | |
1236 ClassTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMember"
, <Object> [emptyCommentAndMetadata()], "typedef C = S with M;"); | |
1237 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
1238 JUnitTestCase.assertEquals("C", typeAlias.name.name); | |
1239 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
1240 JUnitTestCase.assertNotNull(typeAlias.equals); | |
1241 JUnitTestCase.assertNull(typeAlias.abstractKeyword); | |
1242 JUnitTestCase.assertEquals("S", typeAlias.superclass.name.name); | |
1243 JUnitTestCase.assertNotNull(typeAlias.withClause); | |
1244 JUnitTestCase.assertNull(typeAlias.implementsClause); | |
1245 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
1246 } | |
1247 void test_parseCompilationUnitMember_typedef_function() { | |
1248 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseCompilationUnitMemb
er", <Object> [emptyCommentAndMetadata()], "typedef F();"); | |
1249 JUnitTestCase.assertEquals("F", typeAlias.name.name); | |
1250 EngineTestCase.assertSize(0, typeAlias.parameters.parameters); | |
1251 } | |
1252 void test_parseCompilationUnitMember_variable() { | |
1253 TopLevelVariableDeclaration declaration = ParserTestCase.parse("parseCompila
tionUnitMember", <Object> [emptyCommentAndMetadata()], "var x = 0;"); | |
1254 JUnitTestCase.assertNotNull(declaration.semicolon); | |
1255 JUnitTestCase.assertNotNull(declaration.variables); | |
1256 } | |
1257 void test_parseConditionalExpression() { | |
1258 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx
pression", "x ? y : z", []); | |
1259 JUnitTestCase.assertNotNull(expression.condition); | |
1260 JUnitTestCase.assertNotNull(expression.question); | |
1261 JUnitTestCase.assertNotNull(expression.thenExpression); | |
1262 JUnitTestCase.assertNotNull(expression.colon); | |
1263 JUnitTestCase.assertNotNull(expression.elseExpression); | |
1264 } | |
1265 void test_parseConstExpression_instanceCreation() { | |
1266 InstanceCreationExpression expression = ParserTestCase.parse6("parseConstExp
ression", "const A()", []); | |
1267 JUnitTestCase.assertNotNull(expression.keyword); | |
1268 ConstructorName name = expression.constructorName; | |
1269 JUnitTestCase.assertNotNull(name); | |
1270 JUnitTestCase.assertNotNull(name.type); | |
1271 JUnitTestCase.assertNull(name.period); | |
1272 JUnitTestCase.assertNull(name.name); | |
1273 JUnitTestCase.assertNotNull(expression.argumentList); | |
1274 } | |
1275 void test_parseConstExpression_listLiteral_typed() { | |
1276 ListLiteral literal = ParserTestCase.parse6("parseConstExpression", "const <
A> []", []); | |
1277 JUnitTestCase.assertNotNull(literal.modifier); | |
1278 JUnitTestCase.assertNotNull(literal.typeArguments); | |
1279 JUnitTestCase.assertNotNull(literal.leftBracket); | |
1280 EngineTestCase.assertSize(0, literal.elements); | |
1281 JUnitTestCase.assertNotNull(literal.rightBracket); | |
1282 } | |
1283 void test_parseConstExpression_listLiteral_untyped() { | |
1284 ListLiteral literal = ParserTestCase.parse6("parseConstExpression", "const [
]", []); | |
1285 JUnitTestCase.assertNotNull(literal.modifier); | |
1286 JUnitTestCase.assertNull(literal.typeArguments); | |
1287 JUnitTestCase.assertNotNull(literal.leftBracket); | |
1288 EngineTestCase.assertSize(0, literal.elements); | |
1289 JUnitTestCase.assertNotNull(literal.rightBracket); | |
1290 } | |
1291 void test_parseConstExpression_mapLiteral_typed() { | |
1292 MapLiteral literal = ParserTestCase.parse6("parseConstExpression", "const <A
> {}", []); | |
1293 JUnitTestCase.assertNotNull(literal.leftBracket); | |
1294 EngineTestCase.assertSize(0, literal.entries); | |
1295 JUnitTestCase.assertNotNull(literal.rightBracket); | |
1296 JUnitTestCase.assertNotNull(literal.typeArguments); | |
1297 } | |
1298 void test_parseConstExpression_mapLiteral_untyped() { | |
1299 MapLiteral literal = ParserTestCase.parse6("parseConstExpression", "const {}
", []); | |
1300 JUnitTestCase.assertNotNull(literal.leftBracket); | |
1301 EngineTestCase.assertSize(0, literal.entries); | |
1302 JUnitTestCase.assertNotNull(literal.rightBracket); | |
1303 JUnitTestCase.assertNull(literal.typeArguments); | |
1304 } | |
1305 void test_parseConstructor() { | |
1306 } | |
1307 void test_parseConstructorFieldInitializer_qualified() { | |
1308 ConstructorFieldInitializer invocation = ParserTestCase.parse6("parseConstru
ctorFieldInitializer", "this.a = b", []); | |
1309 JUnitTestCase.assertNotNull(invocation.equals); | |
1310 JUnitTestCase.assertNotNull(invocation.expression); | |
1311 JUnitTestCase.assertNotNull(invocation.fieldName); | |
1312 JUnitTestCase.assertNotNull(invocation.keyword); | |
1313 JUnitTestCase.assertNotNull(invocation.period); | |
1314 } | |
1315 void test_parseConstructorFieldInitializer_unqualified() { | |
1316 ConstructorFieldInitializer invocation = ParserTestCase.parse6("parseConstru
ctorFieldInitializer", "a = b", []); | |
1317 JUnitTestCase.assertNotNull(invocation.equals); | |
1318 JUnitTestCase.assertNotNull(invocation.expression); | |
1319 JUnitTestCase.assertNotNull(invocation.fieldName); | |
1320 JUnitTestCase.assertNull(invocation.keyword); | |
1321 JUnitTestCase.assertNull(invocation.period); | |
1322 } | |
1323 void test_parseConstructorName_named_noPrefix() { | |
1324 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "A.n;",
[]); | |
1325 JUnitTestCase.assertNotNull(name.type); | |
1326 JUnitTestCase.assertNull(name.period); | |
1327 JUnitTestCase.assertNull(name.name); | |
1328 } | |
1329 void test_parseConstructorName_named_prefixed() { | |
1330 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "p.A.n;
", []); | |
1331 JUnitTestCase.assertNotNull(name.type); | |
1332 JUnitTestCase.assertNotNull(name.period); | |
1333 JUnitTestCase.assertNotNull(name.name); | |
1334 } | |
1335 void test_parseConstructorName_unnamed_noPrefix() { | |
1336 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "A;", [
]); | |
1337 JUnitTestCase.assertNotNull(name.type); | |
1338 JUnitTestCase.assertNull(name.period); | |
1339 JUnitTestCase.assertNull(name.name); | |
1340 } | |
1341 void test_parseConstructorName_unnamed_prefixed() { | |
1342 ConstructorName name = ParserTestCase.parse6("parseConstructorName", "p.A;",
[]); | |
1343 JUnitTestCase.assertNotNull(name.type); | |
1344 JUnitTestCase.assertNull(name.period); | |
1345 JUnitTestCase.assertNull(name.name); | |
1346 } | |
1347 void test_parseContinueStatement_label() { | |
1348 ContinueStatement statement = ParserTestCase.parse6("parseContinueStatement"
, "continue foo;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | |
1349 JUnitTestCase.assertNotNull(statement.keyword); | |
1350 JUnitTestCase.assertNotNull(statement.label); | |
1351 JUnitTestCase.assertNotNull(statement.semicolon); | |
1352 } | |
1353 void test_parseContinueStatement_noLabel() { | |
1354 ContinueStatement statement = ParserTestCase.parse6("parseContinueStatement"
, "continue;", [ParserErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | |
1355 JUnitTestCase.assertNotNull(statement.keyword); | |
1356 JUnitTestCase.assertNull(statement.label); | |
1357 JUnitTestCase.assertNotNull(statement.semicolon); | |
1358 } | |
1359 void test_parseDirective_export() { | |
1360 ExportDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "export 'lib/lib.dart';"); | |
1361 JUnitTestCase.assertNotNull(directive.keyword); | |
1362 JUnitTestCase.assertNotNull(directive.uri); | |
1363 EngineTestCase.assertSize(0, directive.combinators); | |
1364 JUnitTestCase.assertNotNull(directive.semicolon); | |
1365 } | |
1366 void test_parseDirective_import() { | |
1367 ImportDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "import 'lib/lib.dart';"); | |
1368 JUnitTestCase.assertNotNull(directive.keyword); | |
1369 JUnitTestCase.assertNotNull(directive.uri); | |
1370 JUnitTestCase.assertNull(directive.asToken); | |
1371 JUnitTestCase.assertNull(directive.prefix); | |
1372 EngineTestCase.assertSize(0, directive.combinators); | |
1373 JUnitTestCase.assertNotNull(directive.semicolon); | |
1374 } | |
1375 void test_parseDirective_library() { | |
1376 LibraryDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "library l;"); | |
1377 JUnitTestCase.assertNotNull(directive.libraryToken); | |
1378 JUnitTestCase.assertNotNull(directive.name); | |
1379 JUnitTestCase.assertNotNull(directive.semicolon); | |
1380 } | |
1381 void test_parseDirective_part() { | |
1382 PartDirective directive = ParserTestCase.parse("parseDirective", <Object> [e
mptyCommentAndMetadata()], "part 'lib/lib.dart';"); | |
1383 JUnitTestCase.assertNotNull(directive.partToken); | |
1384 JUnitTestCase.assertNotNull(directive.uri); | |
1385 JUnitTestCase.assertNotNull(directive.semicolon); | |
1386 } | |
1387 void test_parseDirective_partOf() { | |
1388 PartOfDirective directive = ParserTestCase.parse("parseDirective", <Object>
[emptyCommentAndMetadata()], "part of l;"); | |
1389 JUnitTestCase.assertNotNull(directive.partToken); | |
1390 JUnitTestCase.assertNotNull(directive.ofToken); | |
1391 JUnitTestCase.assertNotNull(directive.libraryName); | |
1392 JUnitTestCase.assertNotNull(directive.semicolon); | |
1393 } | |
1394 void test_parseDocumentationComment_block() { | |
1395 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/** */
class", []); | |
1396 JUnitTestCase.assertFalse(comment.isBlock()); | |
1397 JUnitTestCase.assertTrue(comment.isDocumentation()); | |
1398 JUnitTestCase.assertFalse(comment.isEndOfLine()); | |
1399 } | |
1400 void test_parseDocumentationComment_block_withReference() { | |
1401 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/** [a
] */ class", []); | |
1402 JUnitTestCase.assertFalse(comment.isBlock()); | |
1403 JUnitTestCase.assertTrue(comment.isDocumentation()); | |
1404 JUnitTestCase.assertFalse(comment.isEndOfLine()); | |
1405 NodeList<CommentReference> references2 = comment.references; | |
1406 EngineTestCase.assertSize(1, references2); | |
1407 CommentReference reference = references2[0]; | |
1408 JUnitTestCase.assertNotNull(reference); | |
1409 JUnitTestCase.assertEquals(5, reference.offset); | |
1410 } | |
1411 void test_parseDocumentationComment_endOfLine() { | |
1412 Comment comment = ParserTestCase.parse6("parseDocumentationComment", "/// \n
/// \n class", []); | |
1413 JUnitTestCase.assertFalse(comment.isBlock()); | |
1414 JUnitTestCase.assertTrue(comment.isDocumentation()); | |
1415 JUnitTestCase.assertFalse(comment.isEndOfLine()); | |
1416 } | |
1417 void test_parseDoStatement() { | |
1418 DoStatement statement = ParserTestCase.parse6("parseDoStatement", "do {} whi
le (x);", []); | |
1419 JUnitTestCase.assertNotNull(statement.doKeyword); | |
1420 JUnitTestCase.assertNotNull(statement.body); | |
1421 JUnitTestCase.assertNotNull(statement.whileKeyword); | |
1422 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1423 JUnitTestCase.assertNotNull(statement.condition); | |
1424 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1425 JUnitTestCase.assertNotNull(statement.semicolon); | |
1426 } | |
1427 void test_parseEmptyStatement() { | |
1428 EmptyStatement statement = ParserTestCase.parse6("parseEmptyStatement", ";",
[]); | |
1429 JUnitTestCase.assertNotNull(statement.semicolon); | |
1430 } | |
1431 void test_parseEqualityExpression_normal() { | |
1432 BinaryExpression expression = ParserTestCase.parse6("parseEqualityExpression
", "x == y", []); | |
1433 JUnitTestCase.assertNotNull(expression.leftOperand); | |
1434 JUnitTestCase.assertNotNull(expression.operator); | |
1435 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | |
1436 JUnitTestCase.assertNotNull(expression.rightOperand); | |
1437 } | |
1438 void test_parseEqualityExpression_super() { | |
1439 BinaryExpression expression = ParserTestCase.parse6("parseEqualityExpression
", "super == y", []); | |
1440 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | |
1441 JUnitTestCase.assertNotNull(expression.operator); | |
1442 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | |
1443 JUnitTestCase.assertNotNull(expression.rightOperand); | |
1444 } | |
1445 void test_parseExportDirective_hide() { | |
1446 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A, B;"); | |
1447 JUnitTestCase.assertNotNull(directive.keyword); | |
1448 JUnitTestCase.assertNotNull(directive.uri); | |
1449 EngineTestCase.assertSize(1, directive.combinators); | |
1450 JUnitTestCase.assertNotNull(directive.semicolon); | |
1451 } | |
1452 void test_parseExportDirective_hide_show() { | |
1453 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' hide A show B;"); | |
1454 JUnitTestCase.assertNotNull(directive.keyword); | |
1455 JUnitTestCase.assertNotNull(directive.uri); | |
1456 EngineTestCase.assertSize(2, directive.combinators); | |
1457 JUnitTestCase.assertNotNull(directive.semicolon); | |
1458 } | |
1459 void test_parseExportDirective_noCombinator() { | |
1460 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart';"); | |
1461 JUnitTestCase.assertNotNull(directive.keyword); | |
1462 JUnitTestCase.assertNotNull(directive.uri); | |
1463 EngineTestCase.assertSize(0, directive.combinators); | |
1464 JUnitTestCase.assertNotNull(directive.semicolon); | |
1465 } | |
1466 void test_parseExportDirective_show() { | |
1467 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show A, B;"); | |
1468 JUnitTestCase.assertNotNull(directive.keyword); | |
1469 JUnitTestCase.assertNotNull(directive.uri); | |
1470 EngineTestCase.assertSize(1, directive.combinators); | |
1471 JUnitTestCase.assertNotNull(directive.semicolon); | |
1472 } | |
1473 void test_parseExportDirective_show_hide() { | |
1474 ExportDirective directive = ParserTestCase.parse("parseExportDirective", <Ob
ject> [emptyCommentAndMetadata()], "export 'lib/lib.dart' show B hide A;"); | |
1475 JUnitTestCase.assertNotNull(directive.keyword); | |
1476 JUnitTestCase.assertNotNull(directive.uri); | |
1477 EngineTestCase.assertSize(2, directive.combinators); | |
1478 JUnitTestCase.assertNotNull(directive.semicolon); | |
1479 } | |
1480 void test_parseExpression_assign() { | |
1481 AssignmentExpression expression = ParserTestCase.parse6("parseExpression", "
x = y", []); | |
1482 JUnitTestCase.assertNotNull(expression.leftHandSide); | |
1483 JUnitTestCase.assertNotNull(expression.operator); | |
1484 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); | |
1485 JUnitTestCase.assertNotNull(expression.rightHandSide); | |
1486 } | |
1487 void test_parseExpression_comparison() { | |
1488 BinaryExpression expression = ParserTestCase.parse6("parseExpression", "--a.
b == c", []); | |
1489 JUnitTestCase.assertNotNull(expression.leftOperand); | |
1490 JUnitTestCase.assertNotNull(expression.operator); | |
1491 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | |
1492 JUnitTestCase.assertNotNull(expression.rightOperand); | |
1493 } | |
1494 void test_parseExpression_invokeFunctionExpression() { | |
1495 FunctionExpressionInvocation invocation = ParserTestCase.parse6("parseExpres
sion", "(a) {return a + a;} (3)", []); | |
1496 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); | |
1497 FunctionExpression expression = invocation.function as FunctionExpression; | |
1498 JUnitTestCase.assertNotNull(expression.parameters); | |
1499 JUnitTestCase.assertNotNull(expression.body); | |
1500 ArgumentList list = invocation.argumentList; | |
1501 JUnitTestCase.assertNotNull(list); | |
1502 EngineTestCase.assertSize(1, list.arguments); | |
1503 } | |
1504 void test_parseExpression_superMethodInvocation() { | |
1505 MethodInvocation invocation = ParserTestCase.parse6("parseExpression", "supe
r.m()", []); | |
1506 JUnitTestCase.assertNotNull(invocation.target); | |
1507 JUnitTestCase.assertNotNull(invocation.methodName); | |
1508 JUnitTestCase.assertNotNull(invocation.argumentList); | |
1509 } | |
1510 void test_parseExpressionList_multiple() { | |
1511 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2
, 3", []); | |
1512 EngineTestCase.assertSize(3, result); | |
1513 } | |
1514 void test_parseExpressionList_single() { | |
1515 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1",
[]); | |
1516 EngineTestCase.assertSize(1, result); | |
1517 } | |
1518 void test_parseExpressionWithoutCascade_assign() { | |
1519 AssignmentExpression expression = ParserTestCase.parse6("parseExpressionWith
outCascade", "x = y", []); | |
1520 JUnitTestCase.assertNotNull(expression.leftHandSide); | |
1521 JUnitTestCase.assertNotNull(expression.operator); | |
1522 JUnitTestCase.assertEquals(TokenType.EQ, expression.operator.type); | |
1523 JUnitTestCase.assertNotNull(expression.rightHandSide); | |
1524 } | |
1525 void test_parseExpressionWithoutCascade_comparison() { | |
1526 BinaryExpression expression = ParserTestCase.parse6("parseExpressionWithoutC
ascade", "--a.b == c", []); | |
1527 JUnitTestCase.assertNotNull(expression.leftOperand); | |
1528 JUnitTestCase.assertNotNull(expression.operator); | |
1529 JUnitTestCase.assertEquals(TokenType.EQ_EQ, expression.operator.type); | |
1530 JUnitTestCase.assertNotNull(expression.rightOperand); | |
1531 } | |
1532 void test_parseExpressionWithoutCascade_superMethodInvocation() { | |
1533 MethodInvocation invocation = ParserTestCase.parse6("parseExpressionWithoutC
ascade", "super.m()", []); | |
1534 JUnitTestCase.assertNotNull(invocation.target); | |
1535 JUnitTestCase.assertNotNull(invocation.methodName); | |
1536 JUnitTestCase.assertNotNull(invocation.argumentList); | |
1537 } | |
1538 void test_parseExtendsClause() { | |
1539 ExtendsClause clause = ParserTestCase.parse6("parseExtendsClause", "extends
B", []); | |
1540 JUnitTestCase.assertNotNull(clause.keyword); | |
1541 JUnitTestCase.assertNotNull(clause.superclass); | |
1542 EngineTestCase.assertInstanceOf(TypeName, clause.superclass); | |
1543 } | |
1544 void test_parseFinalConstVarOrType_const_noType() { | |
1545 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const"); | |
1546 Token keyword31 = result.keyword; | |
1547 JUnitTestCase.assertNotNull(keyword31); | |
1548 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword31.type); | |
1549 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword31 as KeywordToken)).keyw
ord); | |
1550 JUnitTestCase.assertNull(result.type); | |
1551 } | |
1552 void test_parseFinalConstVarOrType_const_type() { | |
1553 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "const A a"); | |
1554 Token keyword32 = result.keyword; | |
1555 JUnitTestCase.assertNotNull(keyword32); | |
1556 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword32.type); | |
1557 JUnitTestCase.assertEquals(Keyword.CONST, ((keyword32 as KeywordToken)).keyw
ord); | |
1558 JUnitTestCase.assertNotNull(result.type); | |
1559 } | |
1560 void test_parseFinalConstVarOrType_final_noType() { | |
1561 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final"); | |
1562 Token keyword33 = result.keyword; | |
1563 JUnitTestCase.assertNotNull(keyword33); | |
1564 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword33.type); | |
1565 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword33 as KeywordToken)).keyw
ord); | |
1566 JUnitTestCase.assertNull(result.type); | |
1567 } | |
1568 void test_parseFinalConstVarOrType_final_type() { | |
1569 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "final A a"); | |
1570 Token keyword34 = result.keyword; | |
1571 JUnitTestCase.assertNotNull(keyword34); | |
1572 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword34.type); | |
1573 JUnitTestCase.assertEquals(Keyword.FINAL, ((keyword34 as KeywordToken)).keyw
ord); | |
1574 JUnitTestCase.assertNotNull(result.type); | |
1575 } | |
1576 void test_parseFinalConstVarOrType_type_parameterized() { | |
1577 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A<B> a"); | |
1578 JUnitTestCase.assertNull(result.keyword); | |
1579 JUnitTestCase.assertNotNull(result.type); | |
1580 } | |
1581 void test_parseFinalConstVarOrType_type_prefixed() { | |
1582 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A a"); | |
1583 JUnitTestCase.assertNull(result.keyword); | |
1584 JUnitTestCase.assertNotNull(result.type); | |
1585 } | |
1586 void test_parseFinalConstVarOrType_type_prefixedAndParameterized() { | |
1587 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "p.A<B> a"); | |
1588 JUnitTestCase.assertNull(result.keyword); | |
1589 JUnitTestCase.assertNotNull(result.type); | |
1590 } | |
1591 void test_parseFinalConstVarOrType_type_simple() { | |
1592 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "A a"); | |
1593 JUnitTestCase.assertNull(result.keyword); | |
1594 JUnitTestCase.assertNotNull(result.type); | |
1595 } | |
1596 void test_parseFinalConstVarOrType_var() { | |
1597 FinalConstVarOrType result = ParserTestCase.parse("parseFinalConstVarOrType"
, <Object> [false], "var"); | |
1598 Token keyword35 = result.keyword; | |
1599 JUnitTestCase.assertNotNull(keyword35); | |
1600 JUnitTestCase.assertEquals(TokenType.KEYWORD, keyword35.type); | |
1601 JUnitTestCase.assertEquals(Keyword.VAR, ((keyword35 as KeywordToken)).keywor
d); | |
1602 JUnitTestCase.assertNull(result.type); | |
1603 } | |
1604 void test_parseFormalParameter_final_withType_named() { | |
1605 ParameterKind kind = ParameterKind.NAMED; | |
1606 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a : null"); | |
1607 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | |
1608 JUnitTestCase.assertNotNull(simpleParameter.identifier); | |
1609 JUnitTestCase.assertNotNull(simpleParameter.keyword); | |
1610 JUnitTestCase.assertNotNull(simpleParameter.type); | |
1611 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | |
1612 JUnitTestCase.assertNotNull(parameter.separator); | |
1613 JUnitTestCase.assertNotNull(parameter.defaultValue); | |
1614 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1615 } | |
1616 void test_parseFormalParameter_final_withType_normal() { | |
1617 ParameterKind kind = ParameterKind.REQUIRED; | |
1618 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "final A a"); | |
1619 JUnitTestCase.assertNotNull(parameter.identifier); | |
1620 JUnitTestCase.assertNotNull(parameter.keyword); | |
1621 JUnitTestCase.assertNotNull(parameter.type); | |
1622 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1623 } | |
1624 void test_parseFormalParameter_final_withType_positional() { | |
1625 ParameterKind kind = ParameterKind.POSITIONAL; | |
1626 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "final A a = null"); | |
1627 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | |
1628 JUnitTestCase.assertNotNull(simpleParameter.identifier); | |
1629 JUnitTestCase.assertNotNull(simpleParameter.keyword); | |
1630 JUnitTestCase.assertNotNull(simpleParameter.type); | |
1631 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | |
1632 JUnitTestCase.assertNotNull(parameter.separator); | |
1633 JUnitTestCase.assertNotNull(parameter.defaultValue); | |
1634 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1635 } | |
1636 void test_parseFormalParameter_nonFinal_withType_named() { | |
1637 ParameterKind kind = ParameterKind.NAMED; | |
1638 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a : null"); | |
1639 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | |
1640 JUnitTestCase.assertNotNull(simpleParameter.identifier); | |
1641 JUnitTestCase.assertNull(simpleParameter.keyword); | |
1642 JUnitTestCase.assertNotNull(simpleParameter.type); | |
1643 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | |
1644 JUnitTestCase.assertNotNull(parameter.separator); | |
1645 JUnitTestCase.assertNotNull(parameter.defaultValue); | |
1646 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1647 } | |
1648 void test_parseFormalParameter_nonFinal_withType_normal() { | |
1649 ParameterKind kind = ParameterKind.REQUIRED; | |
1650 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "A a"); | |
1651 JUnitTestCase.assertNotNull(parameter.identifier); | |
1652 JUnitTestCase.assertNull(parameter.keyword); | |
1653 JUnitTestCase.assertNotNull(parameter.type); | |
1654 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1655 } | |
1656 void test_parseFormalParameter_nonFinal_withType_positional() { | |
1657 ParameterKind kind = ParameterKind.POSITIONAL; | |
1658 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "A a = null"); | |
1659 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | |
1660 JUnitTestCase.assertNotNull(simpleParameter.identifier); | |
1661 JUnitTestCase.assertNull(simpleParameter.keyword); | |
1662 JUnitTestCase.assertNotNull(simpleParameter.type); | |
1663 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | |
1664 JUnitTestCase.assertNotNull(parameter.separator); | |
1665 JUnitTestCase.assertNotNull(parameter.defaultValue); | |
1666 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1667 } | |
1668 void test_parseFormalParameter_var() { | |
1669 ParameterKind kind = ParameterKind.REQUIRED; | |
1670 SimpleFormalParameter parameter = ParserTestCase.parse("parseFormalParameter
", <Object> [kind], "var a"); | |
1671 JUnitTestCase.assertNotNull(parameter.identifier); | |
1672 JUnitTestCase.assertNotNull(parameter.keyword); | |
1673 JUnitTestCase.assertNull(parameter.type); | |
1674 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1675 } | |
1676 void test_parseFormalParameter_var_named() { | |
1677 ParameterKind kind = ParameterKind.NAMED; | |
1678 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a : null"); | |
1679 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | |
1680 JUnitTestCase.assertNotNull(simpleParameter.identifier); | |
1681 JUnitTestCase.assertNotNull(simpleParameter.keyword); | |
1682 JUnitTestCase.assertNull(simpleParameter.type); | |
1683 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | |
1684 JUnitTestCase.assertNotNull(parameter.separator); | |
1685 JUnitTestCase.assertNotNull(parameter.defaultValue); | |
1686 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1687 } | |
1688 void test_parseFormalParameter_var_positional() { | |
1689 ParameterKind kind = ParameterKind.POSITIONAL; | |
1690 DefaultFormalParameter parameter = ParserTestCase.parse("parseFormalParamete
r", <Object> [kind], "var a = null"); | |
1691 SimpleFormalParameter simpleParameter = parameter.parameter as SimpleFormalP
arameter; | |
1692 JUnitTestCase.assertNotNull(simpleParameter.identifier); | |
1693 JUnitTestCase.assertNotNull(simpleParameter.keyword); | |
1694 JUnitTestCase.assertNull(simpleParameter.type); | |
1695 JUnitTestCase.assertEquals(kind, simpleParameter.kind); | |
1696 JUnitTestCase.assertNotNull(parameter.separator); | |
1697 JUnitTestCase.assertNotNull(parameter.defaultValue); | |
1698 JUnitTestCase.assertEquals(kind, parameter.kind); | |
1699 } | |
1700 void test_parseFormalParameterList_empty() { | |
1701 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "()", []); | |
1702 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1703 JUnitTestCase.assertNull(parameterList.leftDelimiter); | |
1704 EngineTestCase.assertSize(0, parameterList.parameters); | |
1705 JUnitTestCase.assertNull(parameterList.rightDelimiter); | |
1706 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1707 } | |
1708 void test_parseFormalParameterList_named_multiple() { | |
1709 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "({A a : 1, B b, C c : 3})", []); | |
1710 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1711 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | |
1712 EngineTestCase.assertSize(3, parameterList.parameters); | |
1713 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | |
1714 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1715 } | |
1716 void test_parseFormalParameterList_named_single() { | |
1717 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "({A a})", []); | |
1718 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1719 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | |
1720 EngineTestCase.assertSize(1, parameterList.parameters); | |
1721 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | |
1722 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1723 } | |
1724 void test_parseFormalParameterList_normal_multiple() { | |
1725 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "(A a, B b, C c)", []); | |
1726 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1727 JUnitTestCase.assertNull(parameterList.leftDelimiter); | |
1728 EngineTestCase.assertSize(3, parameterList.parameters); | |
1729 JUnitTestCase.assertNull(parameterList.rightDelimiter); | |
1730 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1731 } | |
1732 void test_parseFormalParameterList_normal_named() { | |
1733 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "(A a, {B b})", []); | |
1734 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1735 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | |
1736 EngineTestCase.assertSize(2, parameterList.parameters); | |
1737 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | |
1738 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1739 } | |
1740 void test_parseFormalParameterList_normal_positional() { | |
1741 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "(A a, [B b])", []); | |
1742 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1743 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | |
1744 EngineTestCase.assertSize(2, parameterList.parameters); | |
1745 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | |
1746 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1747 } | |
1748 void test_parseFormalParameterList_normal_single() { | |
1749 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "(A a)", []); | |
1750 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1751 JUnitTestCase.assertNull(parameterList.leftDelimiter); | |
1752 EngineTestCase.assertSize(1, parameterList.parameters); | |
1753 JUnitTestCase.assertNull(parameterList.rightDelimiter); | |
1754 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1755 } | |
1756 void test_parseFormalParameterList_positional_multiple() { | |
1757 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "([A a = null, B b, C c = null])", []); | |
1758 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1759 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | |
1760 EngineTestCase.assertSize(3, parameterList.parameters); | |
1761 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | |
1762 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1763 } | |
1764 void test_parseFormalParameterList_positional_single() { | |
1765 FormalParameterList parameterList = ParserTestCase.parse6("parseFormalParame
terList", "([A a = null])", []); | |
1766 JUnitTestCase.assertNotNull(parameterList.leftParenthesis); | |
1767 JUnitTestCase.assertNotNull(parameterList.leftDelimiter); | |
1768 EngineTestCase.assertSize(1, parameterList.parameters); | |
1769 JUnitTestCase.assertNotNull(parameterList.rightDelimiter); | |
1770 JUnitTestCase.assertNotNull(parameterList.rightParenthesis); | |
1771 } | |
1772 void test_parseForStatement_each_identifier() { | |
1773 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(element in list) {}", []); | |
1774 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1775 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1776 JUnitTestCase.assertNotNull(statement.loopVariable); | |
1777 JUnitTestCase.assertNotNull(statement.inKeyword); | |
1778 JUnitTestCase.assertNotNull(statement.iterator); | |
1779 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1780 JUnitTestCase.assertNotNull(statement.body); | |
1781 } | |
1782 void test_parseForStatement_each_noType() { | |
1783 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(element in list) {}", []); | |
1784 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1785 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1786 JUnitTestCase.assertNotNull(statement.loopVariable); | |
1787 JUnitTestCase.assertNotNull(statement.inKeyword); | |
1788 JUnitTestCase.assertNotNull(statement.iterator); | |
1789 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1790 JUnitTestCase.assertNotNull(statement.body); | |
1791 } | |
1792 void test_parseForStatement_each_type() { | |
1793 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(A element in list) {}", []); | |
1794 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1795 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1796 JUnitTestCase.assertNotNull(statement.loopVariable); | |
1797 JUnitTestCase.assertNotNull(statement.inKeyword); | |
1798 JUnitTestCase.assertNotNull(statement.iterator); | |
1799 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1800 JUnitTestCase.assertNotNull(statement.body); | |
1801 } | |
1802 void test_parseForStatement_each_var() { | |
1803 ForEachStatement statement = ParserTestCase.parse6("parseForStatement", "for
(var element in list) {}", []); | |
1804 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1805 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1806 JUnitTestCase.assertNotNull(statement.loopVariable); | |
1807 JUnitTestCase.assertNotNull(statement.inKeyword); | |
1808 JUnitTestCase.assertNotNull(statement.iterator); | |
1809 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1810 JUnitTestCase.assertNotNull(statement.body); | |
1811 } | |
1812 void test_parseForStatement_loop_c() { | |
1813 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;
i < count;) {}", []); | |
1814 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1815 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1816 JUnitTestCase.assertNull(statement.variables); | |
1817 JUnitTestCase.assertNull(statement.initialization); | |
1818 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1819 JUnitTestCase.assertNotNull(statement.condition); | |
1820 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1821 EngineTestCase.assertSize(0, statement.updaters); | |
1822 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1823 JUnitTestCase.assertNotNull(statement.body); | |
1824 } | |
1825 void test_parseForStatement_loop_cu() { | |
1826 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;
i < count; i++) {}", []); | |
1827 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1828 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1829 JUnitTestCase.assertNull(statement.variables); | |
1830 JUnitTestCase.assertNull(statement.initialization); | |
1831 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1832 JUnitTestCase.assertNotNull(statement.condition); | |
1833 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1834 EngineTestCase.assertSize(1, statement.updaters); | |
1835 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1836 JUnitTestCase.assertNotNull(statement.body); | |
1837 } | |
1838 void test_parseForStatement_loop_ecu() { | |
1839 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (i-
-; i < count; i++) {}", []); | |
1840 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1841 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1842 JUnitTestCase.assertNull(statement.variables); | |
1843 JUnitTestCase.assertNotNull(statement.initialization); | |
1844 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1845 JUnitTestCase.assertNotNull(statement.condition); | |
1846 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1847 EngineTestCase.assertSize(1, statement.updaters); | |
1848 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1849 JUnitTestCase.assertNotNull(statement.body); | |
1850 } | |
1851 void test_parseForStatement_loop_i() { | |
1852 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va
r i = 0;;) {}", []); | |
1853 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1854 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1855 VariableDeclarationList variables8 = statement.variables; | |
1856 JUnitTestCase.assertNotNull(variables8); | |
1857 EngineTestCase.assertSize(1, variables8.variables); | |
1858 JUnitTestCase.assertNull(statement.initialization); | |
1859 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1860 JUnitTestCase.assertNull(statement.condition); | |
1861 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1862 EngineTestCase.assertSize(0, statement.updaters); | |
1863 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1864 JUnitTestCase.assertNotNull(statement.body); | |
1865 } | |
1866 void test_parseForStatement_loop_ic() { | |
1867 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va
r i = 0; i < count;) {}", []); | |
1868 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1869 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1870 VariableDeclarationList variables9 = statement.variables; | |
1871 JUnitTestCase.assertNotNull(variables9); | |
1872 EngineTestCase.assertSize(1, variables9.variables); | |
1873 JUnitTestCase.assertNull(statement.initialization); | |
1874 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1875 JUnitTestCase.assertNotNull(statement.condition); | |
1876 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1877 EngineTestCase.assertSize(0, statement.updaters); | |
1878 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1879 JUnitTestCase.assertNotNull(statement.body); | |
1880 } | |
1881 void test_parseForStatement_loop_icu() { | |
1882 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va
r i = 0; i < count; i++) {}", []); | |
1883 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1884 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1885 VariableDeclarationList variables10 = statement.variables; | |
1886 JUnitTestCase.assertNotNull(variables10); | |
1887 EngineTestCase.assertSize(1, variables10.variables); | |
1888 JUnitTestCase.assertNull(statement.initialization); | |
1889 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1890 JUnitTestCase.assertNotNull(statement.condition); | |
1891 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1892 EngineTestCase.assertSize(1, statement.updaters); | |
1893 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1894 JUnitTestCase.assertNotNull(statement.body); | |
1895 } | |
1896 void test_parseForStatement_loop_iicuu() { | |
1897 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (in
t i = 0, j = count; i < j; i++, j--) {}", []); | |
1898 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1899 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1900 VariableDeclarationList variables11 = statement.variables; | |
1901 JUnitTestCase.assertNotNull(variables11); | |
1902 EngineTestCase.assertSize(2, variables11.variables); | |
1903 JUnitTestCase.assertNull(statement.initialization); | |
1904 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1905 JUnitTestCase.assertNotNull(statement.condition); | |
1906 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1907 EngineTestCase.assertSize(2, statement.updaters); | |
1908 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1909 JUnitTestCase.assertNotNull(statement.body); | |
1910 } | |
1911 void test_parseForStatement_loop_iu() { | |
1912 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (va
r i = 0;; i++) {}", []); | |
1913 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1914 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1915 VariableDeclarationList variables12 = statement.variables; | |
1916 JUnitTestCase.assertNotNull(variables12); | |
1917 EngineTestCase.assertSize(1, variables12.variables); | |
1918 JUnitTestCase.assertNull(statement.initialization); | |
1919 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1920 JUnitTestCase.assertNull(statement.condition); | |
1921 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1922 EngineTestCase.assertSize(1, statement.updaters); | |
1923 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1924 JUnitTestCase.assertNotNull(statement.body); | |
1925 } | |
1926 void test_parseForStatement_loop_u() { | |
1927 ForStatement statement = ParserTestCase.parse6("parseForStatement", "for (;;
i++) {}", []); | |
1928 JUnitTestCase.assertNotNull(statement.forKeyword); | |
1929 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
1930 JUnitTestCase.assertNull(statement.variables); | |
1931 JUnitTestCase.assertNull(statement.initialization); | |
1932 JUnitTestCase.assertNotNull(statement.leftSeparator); | |
1933 JUnitTestCase.assertNull(statement.condition); | |
1934 JUnitTestCase.assertNotNull(statement.rightSeparator); | |
1935 EngineTestCase.assertSize(1, statement.updaters); | |
1936 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
1937 JUnitTestCase.assertNotNull(statement.body); | |
1938 } | |
1939 void test_parseFunctionBody_block() { | |
1940 BlockFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <
Object> [false, false], "{}"); | |
1941 JUnitTestCase.assertNotNull(functionBody.block); | |
1942 } | |
1943 void test_parseFunctionBody_empty() { | |
1944 EmptyFunctionBody functionBody = ParserTestCase.parse("parseFunctionBody", <
Object> [true, false], ";"); | |
1945 JUnitTestCase.assertNotNull(functionBody.semicolon); | |
1946 } | |
1947 void test_parseFunctionBody_expression() { | |
1948 ExpressionFunctionBody functionBody = ParserTestCase.parse("parseFunctionBod
y", <Object> [false, false], "=> y;"); | |
1949 JUnitTestCase.assertNotNull(functionBody.functionDefinition); | |
1950 JUnitTestCase.assertNotNull(functionBody.expression); | |
1951 JUnitTestCase.assertNotNull(functionBody.semicolon); | |
1952 } | |
1953 void test_parseFunctionDeclaration_function() { | |
1954 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
1955 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
1956 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType], "f() {}"); | |
1957 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | |
1958 JUnitTestCase.assertEquals(returnType, declaration.returnType); | |
1959 JUnitTestCase.assertNotNull(declaration.name); | |
1960 FunctionExpression expression = declaration.functionExpression; | |
1961 JUnitTestCase.assertNotNull(expression); | |
1962 JUnitTestCase.assertNotNull(expression.body); | |
1963 JUnitTestCase.assertNotNull(expression.parameters); | |
1964 JUnitTestCase.assertNull(declaration.propertyKeyword); | |
1965 } | |
1966 void test_parseFunctionDeclaration_getter() { | |
1967 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
1968 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
1969 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType], "get p => 0
;"); | |
1970 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | |
1971 JUnitTestCase.assertEquals(returnType, declaration.returnType); | |
1972 JUnitTestCase.assertNotNull(declaration.name); | |
1973 FunctionExpression expression = declaration.functionExpression; | |
1974 JUnitTestCase.assertNotNull(expression); | |
1975 JUnitTestCase.assertNotNull(expression.body); | |
1976 JUnitTestCase.assertNull(expression.parameters); | |
1977 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1978 } | |
1979 void test_parseFunctionDeclaration_setter() { | |
1980 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
1981 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
1982 FunctionDeclaration declaration = ParserTestCase.parse("parseFunctionDeclara
tion", <Object> [commentAndMetadata(comment, []), null, returnType], "set p(v) {
}"); | |
1983 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | |
1984 JUnitTestCase.assertEquals(returnType, declaration.returnType); | |
1985 JUnitTestCase.assertNotNull(declaration.name); | |
1986 FunctionExpression expression = declaration.functionExpression; | |
1987 JUnitTestCase.assertNotNull(expression); | |
1988 JUnitTestCase.assertNotNull(expression.body); | |
1989 JUnitTestCase.assertNotNull(expression.parameters); | |
1990 JUnitTestCase.assertNotNull(declaration.propertyKeyword); | |
1991 } | |
1992 void test_parseFunctionDeclarationStatement() { | |
1993 FunctionDeclarationStatement statement = ParserTestCase.parse6("parseFunctio
nDeclarationStatement", "void f(int p) => p * 2;", []); | |
1994 JUnitTestCase.assertNotNull(statement.functionDeclaration); | |
1995 } | |
1996 void test_parseFunctionExpression_body_inExpression() { | |
1997 FunctionExpression expression = ParserTestCase.parse6("parseFunctionExpressi
on", "(int i) => i++", []); | |
1998 JUnitTestCase.assertNotNull(expression.body); | |
1999 JUnitTestCase.assertNotNull(expression.parameters); | |
2000 JUnitTestCase.assertNull(((expression.body as ExpressionFunctionBody)).semic
olon); | |
2001 } | |
2002 void test_parseFunctionExpression_minimal() { | |
2003 FunctionExpression expression = ParserTestCase.parse6("parseFunctionExpressi
on", "() {}", []); | |
2004 JUnitTestCase.assertNotNull(expression.body); | |
2005 JUnitTestCase.assertNotNull(expression.parameters); | |
2006 } | |
2007 void test_parseGetter_nonStatic() { | |
2008 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
2009 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
2010 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com
mentAndMetadata(comment, []), null, null, returnType], "get a;"); | |
2011 JUnitTestCase.assertNotNull(method.body); | |
2012 JUnitTestCase.assertEquals(comment, method.documentationComment); | |
2013 JUnitTestCase.assertNull(method.externalKeyword); | |
2014 JUnitTestCase.assertNull(method.modifierKeyword); | |
2015 JUnitTestCase.assertNotNull(method.name); | |
2016 JUnitTestCase.assertNull(method.operatorKeyword); | |
2017 JUnitTestCase.assertNull(method.parameters); | |
2018 JUnitTestCase.assertNotNull(method.propertyKeyword); | |
2019 JUnitTestCase.assertEquals(returnType, method.returnType); | |
2020 } | |
2021 void test_parseGetter_static() { | |
2022 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
2023 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | |
2024 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
2025 MethodDeclaration method = ParserTestCase.parse("parseGetter", <Object> [com
mentAndMetadata(comment, []), null, staticKeyword, returnType], "get a;"); | |
2026 JUnitTestCase.assertNotNull(method.body); | |
2027 JUnitTestCase.assertEquals(comment, method.documentationComment); | |
2028 JUnitTestCase.assertNull(method.externalKeyword); | |
2029 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); | |
2030 JUnitTestCase.assertNotNull(method.name); | |
2031 JUnitTestCase.assertNull(method.operatorKeyword); | |
2032 JUnitTestCase.assertNull(method.parameters); | |
2033 JUnitTestCase.assertNotNull(method.propertyKeyword); | |
2034 JUnitTestCase.assertEquals(returnType, method.returnType); | |
2035 } | |
2036 void test_parseIdentifierList_multiple() { | |
2037 List<SimpleIdentifier> list = ParserTestCase.parse6("parseIdentifierList", "
a, b, c", []); | |
2038 EngineTestCase.assertSize(3, list); | |
2039 } | |
2040 void test_parseIdentifierList_single() { | |
2041 List<SimpleIdentifier> list = ParserTestCase.parse6("parseIdentifierList", "
a", []); | |
2042 EngineTestCase.assertSize(1, list); | |
2043 } | |
2044 void test_parseIfStatement_else_block() { | |
2045 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) {}
else {}", []); | |
2046 JUnitTestCase.assertNotNull(statement.ifKeyword); | |
2047 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
2048 JUnitTestCase.assertNotNull(statement.condition); | |
2049 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
2050 JUnitTestCase.assertNotNull(statement.thenStatement); | |
2051 JUnitTestCase.assertNotNull(statement.elseKeyword); | |
2052 JUnitTestCase.assertNotNull(statement.elseStatement); | |
2053 } | |
2054 void test_parseIfStatement_else_statement() { | |
2055 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) f(
x); else f(y);", []); | |
2056 JUnitTestCase.assertNotNull(statement.ifKeyword); | |
2057 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
2058 JUnitTestCase.assertNotNull(statement.condition); | |
2059 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
2060 JUnitTestCase.assertNotNull(statement.thenStatement); | |
2061 JUnitTestCase.assertNotNull(statement.elseKeyword); | |
2062 JUnitTestCase.assertNotNull(statement.elseStatement); | |
2063 } | |
2064 void test_parseIfStatement_noElse_block() { | |
2065 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) {}
", []); | |
2066 JUnitTestCase.assertNotNull(statement.ifKeyword); | |
2067 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
2068 JUnitTestCase.assertNotNull(statement.condition); | |
2069 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
2070 JUnitTestCase.assertNotNull(statement.thenStatement); | |
2071 JUnitTestCase.assertNull(statement.elseKeyword); | |
2072 JUnitTestCase.assertNull(statement.elseStatement); | |
2073 } | |
2074 void test_parseIfStatement_noElse_statement() { | |
2075 IfStatement statement = ParserTestCase.parse6("parseIfStatement", "if (x) f(
x);", []); | |
2076 JUnitTestCase.assertNotNull(statement.ifKeyword); | |
2077 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
2078 JUnitTestCase.assertNotNull(statement.condition); | |
2079 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
2080 JUnitTestCase.assertNotNull(statement.thenStatement); | |
2081 JUnitTestCase.assertNull(statement.elseKeyword); | |
2082 JUnitTestCase.assertNull(statement.elseStatement); | |
2083 } | |
2084 void test_parseImplementsClause_multiple() { | |
2085 ImplementsClause clause = ParserTestCase.parse6("parseImplementsClause", "im
plements A, B, C", []); | |
2086 EngineTestCase.assertSize(3, clause.interfaces); | |
2087 JUnitTestCase.assertNotNull(clause.keyword); | |
2088 } | |
2089 void test_parseImplementsClause_single() { | |
2090 ImplementsClause clause = ParserTestCase.parse6("parseImplementsClause", "im
plements A", []); | |
2091 EngineTestCase.assertSize(1, clause.interfaces); | |
2092 JUnitTestCase.assertNotNull(clause.keyword); | |
2093 } | |
2094 void test_parseImportDirective_hide() { | |
2095 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' hide A, B;"); | |
2096 JUnitTestCase.assertNotNull(directive.keyword); | |
2097 JUnitTestCase.assertNotNull(directive.uri); | |
2098 JUnitTestCase.assertNull(directive.asToken); | |
2099 JUnitTestCase.assertNull(directive.prefix); | |
2100 EngineTestCase.assertSize(1, directive.combinators); | |
2101 JUnitTestCase.assertNotNull(directive.semicolon); | |
2102 } | |
2103 void test_parseImportDirective_noCombinator() { | |
2104 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart';"); | |
2105 JUnitTestCase.assertNotNull(directive.keyword); | |
2106 JUnitTestCase.assertNotNull(directive.uri); | |
2107 JUnitTestCase.assertNull(directive.asToken); | |
2108 JUnitTestCase.assertNull(directive.prefix); | |
2109 EngineTestCase.assertSize(0, directive.combinators); | |
2110 JUnitTestCase.assertNotNull(directive.semicolon); | |
2111 } | |
2112 void test_parseImportDirective_prefix() { | |
2113 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a;"); | |
2114 JUnitTestCase.assertNotNull(directive.keyword); | |
2115 JUnitTestCase.assertNotNull(directive.uri); | |
2116 JUnitTestCase.assertNotNull(directive.asToken); | |
2117 JUnitTestCase.assertNotNull(directive.prefix); | |
2118 EngineTestCase.assertSize(0, directive.combinators); | |
2119 JUnitTestCase.assertNotNull(directive.semicolon); | |
2120 } | |
2121 void test_parseImportDirective_prefix_hide_show() { | |
2122 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a hide A show B;"); | |
2123 JUnitTestCase.assertNotNull(directive.keyword); | |
2124 JUnitTestCase.assertNotNull(directive.uri); | |
2125 JUnitTestCase.assertNotNull(directive.asToken); | |
2126 JUnitTestCase.assertNotNull(directive.prefix); | |
2127 EngineTestCase.assertSize(2, directive.combinators); | |
2128 JUnitTestCase.assertNotNull(directive.semicolon); | |
2129 } | |
2130 void test_parseImportDirective_prefix_show_hide() { | |
2131 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' as a show B hide A;"); | |
2132 JUnitTestCase.assertNotNull(directive.keyword); | |
2133 JUnitTestCase.assertNotNull(directive.uri); | |
2134 JUnitTestCase.assertNotNull(directive.asToken); | |
2135 JUnitTestCase.assertNotNull(directive.prefix); | |
2136 EngineTestCase.assertSize(2, directive.combinators); | |
2137 JUnitTestCase.assertNotNull(directive.semicolon); | |
2138 } | |
2139 void test_parseImportDirective_show() { | |
2140 ImportDirective directive = ParserTestCase.parse("parseImportDirective", <Ob
ject> [emptyCommentAndMetadata()], "import 'lib/lib.dart' show A, B;"); | |
2141 JUnitTestCase.assertNotNull(directive.keyword); | |
2142 JUnitTestCase.assertNotNull(directive.uri); | |
2143 JUnitTestCase.assertNull(directive.asToken); | |
2144 JUnitTestCase.assertNull(directive.prefix); | |
2145 EngineTestCase.assertSize(1, directive.combinators); | |
2146 JUnitTestCase.assertNotNull(directive.semicolon); | |
2147 } | |
2148 void test_parseInitializedIdentifierList_type() { | |
2149 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
2150 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | |
2151 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); | |
2152 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, null, type],
"a = 1, b, c = 3;"); | |
2153 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | |
2154 VariableDeclarationList fields4 = declaration.fields; | |
2155 JUnitTestCase.assertNotNull(fields4); | |
2156 JUnitTestCase.assertNull(fields4.keyword); | |
2157 JUnitTestCase.assertEquals(type, fields4.type); | |
2158 EngineTestCase.assertSize(3, fields4.variables); | |
2159 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); | |
2160 JUnitTestCase.assertNotNull(declaration.semicolon); | |
2161 } | |
2162 void test_parseInitializedIdentifierList_var() { | |
2163 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
2164 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | |
2165 Token varKeyword = TokenFactory.token(Keyword.VAR); | |
2166 FieldDeclaration declaration = ParserTestCase.parse("parseInitializedIdentif
ierList", <Object> [commentAndMetadata(comment, []), staticKeyword, varKeyword,
null], "a = 1, b, c = 3;"); | |
2167 JUnitTestCase.assertEquals(comment, declaration.documentationComment); | |
2168 VariableDeclarationList fields5 = declaration.fields; | |
2169 JUnitTestCase.assertNotNull(fields5); | |
2170 JUnitTestCase.assertEquals(varKeyword, fields5.keyword); | |
2171 JUnitTestCase.assertNull(fields5.type); | |
2172 EngineTestCase.assertSize(3, fields5.variables); | |
2173 JUnitTestCase.assertEquals(staticKeyword, declaration.keyword); | |
2174 JUnitTestCase.assertNotNull(declaration.semicolon); | |
2175 } | |
2176 void test_parseInstanceCreationExpression_qualifiedType() { | |
2177 Token token5 = TokenFactory.token(Keyword.NEW); | |
2178 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC
reationExpression", <Object> [token5], "A.B()"); | |
2179 JUnitTestCase.assertEquals(token5, expression.keyword); | |
2180 ConstructorName name = expression.constructorName; | |
2181 JUnitTestCase.assertNotNull(name); | |
2182 JUnitTestCase.assertNotNull(name.type); | |
2183 JUnitTestCase.assertNull(name.period); | |
2184 JUnitTestCase.assertNull(name.name); | |
2185 JUnitTestCase.assertNotNull(expression.argumentList); | |
2186 } | |
2187 void test_parseInstanceCreationExpression_qualifiedType_named() { | |
2188 Token token6 = TokenFactory.token(Keyword.NEW); | |
2189 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC
reationExpression", <Object> [token6], "A.B.c()"); | |
2190 JUnitTestCase.assertEquals(token6, expression.keyword); | |
2191 ConstructorName name = expression.constructorName; | |
2192 JUnitTestCase.assertNotNull(name); | |
2193 JUnitTestCase.assertNotNull(name.type); | |
2194 JUnitTestCase.assertNotNull(name.period); | |
2195 JUnitTestCase.assertNotNull(name.name); | |
2196 JUnitTestCase.assertNotNull(expression.argumentList); | |
2197 } | |
2198 void test_parseInstanceCreationExpression_type() { | |
2199 Token token7 = TokenFactory.token(Keyword.NEW); | |
2200 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC
reationExpression", <Object> [token7], "A()"); | |
2201 JUnitTestCase.assertEquals(token7, expression.keyword); | |
2202 ConstructorName name = expression.constructorName; | |
2203 JUnitTestCase.assertNotNull(name); | |
2204 JUnitTestCase.assertNotNull(name.type); | |
2205 JUnitTestCase.assertNull(name.period); | |
2206 JUnitTestCase.assertNull(name.name); | |
2207 JUnitTestCase.assertNotNull(expression.argumentList); | |
2208 } | |
2209 void test_parseInstanceCreationExpression_type_named() { | |
2210 Token token8 = TokenFactory.token(Keyword.NEW); | |
2211 InstanceCreationExpression expression = ParserTestCase.parse("parseInstanceC
reationExpression", <Object> [token8], "A<B>.c()"); | |
2212 JUnitTestCase.assertEquals(token8, expression.keyword); | |
2213 ConstructorName name = expression.constructorName; | |
2214 JUnitTestCase.assertNotNull(name); | |
2215 JUnitTestCase.assertNotNull(name.type); | |
2216 JUnitTestCase.assertNotNull(name.period); | |
2217 JUnitTestCase.assertNotNull(name.name); | |
2218 JUnitTestCase.assertNotNull(expression.argumentList); | |
2219 } | |
2220 void test_parseLibraryDirective() { | |
2221 LibraryDirective directive = ParserTestCase.parse("parseLibraryDirective", <
Object> [emptyCommentAndMetadata()], "library l;"); | |
2222 JUnitTestCase.assertNotNull(directive.libraryToken); | |
2223 JUnitTestCase.assertNotNull(directive.name); | |
2224 JUnitTestCase.assertNotNull(directive.semicolon); | |
2225 } | |
2226 void test_parseLibraryIdentifier_multiple() { | |
2227 String name = "a.b.c"; | |
2228 LibraryIdentifier identifier = ParserTestCase.parse6("parseLibraryIdentifier
", name, []); | |
2229 JUnitTestCase.assertEquals(name, identifier.name); | |
2230 } | |
2231 void test_parseLibraryIdentifier_single() { | |
2232 String name = "a"; | |
2233 LibraryIdentifier identifier = ParserTestCase.parse6("parseLibraryIdentifier
", name, []); | |
2234 JUnitTestCase.assertEquals(name, identifier.name); | |
2235 } | |
2236 void test_parseListLiteral_empty_oneToken() { | |
2237 Token token9 = TokenFactory.token(Keyword.CONST); | |
2238 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; | |
2239 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok
en9, typeArguments], "[]"); | |
2240 JUnitTestCase.assertEquals(token9, literal.modifier); | |
2241 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); | |
2242 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2243 EngineTestCase.assertSize(0, literal.elements); | |
2244 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2245 } | |
2246 void test_parseListLiteral_empty_twoTokens() { | |
2247 Token token10 = TokenFactory.token(Keyword.CONST); | |
2248 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; | |
2249 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [tok
en10, typeArguments], "[ ]"); | |
2250 JUnitTestCase.assertEquals(token10, literal.modifier); | |
2251 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); | |
2252 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2253 EngineTestCase.assertSize(0, literal.elements); | |
2254 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2255 } | |
2256 void test_parseListLiteral_multiple() { | |
2257 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [nul
l, null], "[1, 2, 3]"); | |
2258 JUnitTestCase.assertNull(literal.modifier); | |
2259 JUnitTestCase.assertNull(literal.typeArguments); | |
2260 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2261 EngineTestCase.assertSize(3, literal.elements); | |
2262 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2263 } | |
2264 void test_parseListLiteral_single() { | |
2265 ListLiteral literal = ParserTestCase.parse("parseListLiteral", <Object> [nul
l, null], "[1]"); | |
2266 JUnitTestCase.assertNull(literal.modifier); | |
2267 JUnitTestCase.assertNull(literal.typeArguments); | |
2268 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2269 EngineTestCase.assertSize(1, literal.elements); | |
2270 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2271 } | |
2272 void test_parseListOrMapLiteral_list_noType() { | |
2273 ListLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object>
[null], "[1]"); | |
2274 JUnitTestCase.assertNull(literal.modifier); | |
2275 JUnitTestCase.assertNull(literal.typeArguments); | |
2276 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2277 EngineTestCase.assertSize(1, literal.elements); | |
2278 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2279 } | |
2280 void test_parseListOrMapLiteral_list_type() { | |
2281 ListLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object>
[null], "<int> [1]"); | |
2282 JUnitTestCase.assertNull(literal.modifier); | |
2283 JUnitTestCase.assertNotNull(literal.typeArguments); | |
2284 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2285 EngineTestCase.assertSize(1, literal.elements); | |
2286 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2287 } | |
2288 void test_parseListOrMapLiteral_map_noType() { | |
2289 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object>
[null], "{'1' : 1}"); | |
2290 JUnitTestCase.assertNull(literal.modifier); | |
2291 JUnitTestCase.assertNull(literal.typeArguments); | |
2292 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2293 EngineTestCase.assertSize(1, literal.entries); | |
2294 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2295 } | |
2296 void test_parseListOrMapLiteral_map_type() { | |
2297 MapLiteral literal = ParserTestCase.parse("parseListOrMapLiteral", <Object>
[null], "<int> {'1' : 1}"); | |
2298 JUnitTestCase.assertNull(literal.modifier); | |
2299 JUnitTestCase.assertNotNull(literal.typeArguments); | |
2300 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2301 EngineTestCase.assertSize(1, literal.entries); | |
2302 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2303 } | |
2304 void test_parseLogicalAndExpression() { | |
2305 BinaryExpression expression = ParserTestCase.parse6("parseLogicalAndExpressi
on", "x && y", []); | |
2306 JUnitTestCase.assertNotNull(expression.leftOperand); | |
2307 JUnitTestCase.assertNotNull(expression.operator); | |
2308 JUnitTestCase.assertEquals(TokenType.AMPERSAND_AMPERSAND, expression.operato
r.type); | |
2309 JUnitTestCase.assertNotNull(expression.rightOperand); | |
2310 } | |
2311 void test_parseLogicalOrExpression() { | |
2312 BinaryExpression expression = ParserTestCase.parse6("parseLogicalOrExpressio
n", "x || y", []); | |
2313 JUnitTestCase.assertNotNull(expression.leftOperand); | |
2314 JUnitTestCase.assertNotNull(expression.operator); | |
2315 JUnitTestCase.assertEquals(TokenType.BAR_BAR, expression.operator.type); | |
2316 JUnitTestCase.assertNotNull(expression.rightOperand); | |
2317 } | |
2318 void test_parseMapLiteral_empty() { | |
2319 Token token11 = TokenFactory.token(Keyword.CONST); | |
2320 TypeArgumentList typeArguments = new TypeArgumentList.full(null, null, null)
; | |
2321 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [token
11, typeArguments], "{}"); | |
2322 JUnitTestCase.assertEquals(token11, literal.modifier); | |
2323 JUnitTestCase.assertEquals(typeArguments, literal.typeArguments); | |
2324 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2325 EngineTestCase.assertSize(0, literal.entries); | |
2326 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2327 } | |
2328 void test_parseMapLiteral_multiple() { | |
2329 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'a' : b, 'x' : y}"); | |
2330 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2331 EngineTestCase.assertSize(2, literal.entries); | |
2332 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2333 } | |
2334 void test_parseMapLiteral_single() { | |
2335 MapLiteral literal = ParserTestCase.parse("parseMapLiteral", <Object> [null,
null], "{'x' : y}"); | |
2336 JUnitTestCase.assertNotNull(literal.leftBracket); | |
2337 EngineTestCase.assertSize(1, literal.entries); | |
2338 JUnitTestCase.assertNotNull(literal.rightBracket); | |
2339 } | |
2340 void test_parseMapLiteralEntry() { | |
2341 MapLiteralEntry entry = ParserTestCase.parse6("parseMapLiteralEntry", "'x' :
y", []); | |
2342 JUnitTestCase.assertNotNull(entry.key); | |
2343 JUnitTestCase.assertNotNull(entry.separator); | |
2344 JUnitTestCase.assertNotNull(entry.value); | |
2345 } | |
2346 void test_parseModifiers_abstract() { | |
2347 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "abstract A",
[]); | |
2348 JUnitTestCase.assertNotNull(modifiers.abstractKeyword); | |
2349 } | |
2350 void test_parseModifiers_const() { | |
2351 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "const A", [])
; | |
2352 JUnitTestCase.assertNotNull(modifiers.constKeyword); | |
2353 } | |
2354 void test_parseModifiers_external() { | |
2355 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "external A",
[]); | |
2356 JUnitTestCase.assertNotNull(modifiers.externalKeyword); | |
2357 } | |
2358 void test_parseModifiers_factory() { | |
2359 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "factory A", [
]); | |
2360 JUnitTestCase.assertNotNull(modifiers.factoryKeyword); | |
2361 } | |
2362 void test_parseModifiers_final() { | |
2363 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "final A", [])
; | |
2364 JUnitTestCase.assertNotNull(modifiers.finalKeyword); | |
2365 } | |
2366 void test_parseModifiers_static() { | |
2367 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "static A", []
); | |
2368 JUnitTestCase.assertNotNull(modifiers.staticKeyword); | |
2369 } | |
2370 void test_parseModifiers_var() { | |
2371 Modifiers modifiers = ParserTestCase.parse6("parseModifiers", "var A", []); | |
2372 JUnitTestCase.assertNotNull(modifiers.varKeyword); | |
2373 } | |
2374 void test_parseMultiplicativeExpression_normal() { | |
2375 BinaryExpression expression = ParserTestCase.parse6("parseMultiplicativeExpr
ession", "x * y", []); | |
2376 JUnitTestCase.assertNotNull(expression.leftOperand); | |
2377 JUnitTestCase.assertNotNull(expression.operator); | |
2378 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); | |
2379 JUnitTestCase.assertNotNull(expression.rightOperand); | |
2380 } | |
2381 void test_parseMultiplicativeExpression_super() { | |
2382 BinaryExpression expression = ParserTestCase.parse6("parseMultiplicativeExpr
ession", "super * y", []); | |
2383 EngineTestCase.assertInstanceOf(SuperExpression, expression.leftOperand); | |
2384 JUnitTestCase.assertNotNull(expression.operator); | |
2385 JUnitTestCase.assertEquals(TokenType.STAR, expression.operator.type); | |
2386 JUnitTestCase.assertNotNull(expression.rightOperand); | |
2387 } | |
2388 void test_parseNewExpression() { | |
2389 InstanceCreationExpression expression = ParserTestCase.parse6("parseNewExpre
ssion", "new A()", []); | |
2390 JUnitTestCase.assertNotNull(expression.keyword); | |
2391 ConstructorName name = expression.constructorName; | |
2392 JUnitTestCase.assertNotNull(name); | |
2393 JUnitTestCase.assertNotNull(name.type); | |
2394 JUnitTestCase.assertNull(name.period); | |
2395 JUnitTestCase.assertNull(name.name); | |
2396 JUnitTestCase.assertNotNull(expression.argumentList); | |
2397 } | |
2398 void test_parseNonLabeledStatement_const_list_empty() { | |
2399 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const [];", []); | |
2400 JUnitTestCase.assertNotNull(statement.expression); | |
2401 } | |
2402 void test_parseNonLabeledStatement_const_list_nonEmpty() { | |
2403 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const [1, 2];", []); | |
2404 JUnitTestCase.assertNotNull(statement.expression); | |
2405 } | |
2406 void test_parseNonLabeledStatement_const_map_empty() { | |
2407 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const {};", []); | |
2408 JUnitTestCase.assertNotNull(statement.expression); | |
2409 } | |
2410 void test_parseNonLabeledStatement_const_map_nonEmpty() { | |
2411 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const {'a' : 1};", []); | |
2412 JUnitTestCase.assertNotNull(statement.expression); | |
2413 } | |
2414 void test_parseNonLabeledStatement_const_object() { | |
2415 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const A();", []); | |
2416 JUnitTestCase.assertNotNull(statement.expression); | |
2417 } | |
2418 void test_parseNonLabeledStatement_const_object_named_typeParameters() { | |
2419 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "const A<B>.c();", []); | |
2420 JUnitTestCase.assertNotNull(statement.expression); | |
2421 } | |
2422 void test_parseNonLabeledStatement_constructorInvocation() { | |
2423 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "new C().m();", []); | |
2424 JUnitTestCase.assertNotNull(statement.expression); | |
2425 } | |
2426 void test_parseNonLabeledStatement_false() { | |
2427 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "false;", []); | |
2428 JUnitTestCase.assertNotNull(statement.expression); | |
2429 } | |
2430 void test_parseNonLabeledStatement_functionDeclaration() { | |
2431 ParserTestCase.parse6("parseNonLabeledStatement", "f() {};", []); | |
2432 } | |
2433 void test_parseNonLabeledStatement_functionDeclaration_arguments() { | |
2434 ParserTestCase.parse6("parseNonLabeledStatement", "f(void g()) {};", []); | |
2435 } | |
2436 void test_parseNonLabeledStatement_functionExpressionIndex() { | |
2437 ParserTestCase.parse6("parseNonLabeledStatement", "() {}[0] = null;", []); | |
2438 } | |
2439 void test_parseNonLabeledStatement_functionInvocation() { | |
2440 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "f();", []); | |
2441 JUnitTestCase.assertNotNull(statement.expression); | |
2442 } | |
2443 void test_parseNonLabeledStatement_invokeFunctionExpression() { | |
2444 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "(a) {return a + a;} (3);", []); | |
2445 EngineTestCase.assertInstanceOf(FunctionExpressionInvocation, statement.expr
ession); | |
2446 FunctionExpressionInvocation invocation = statement.expression as FunctionEx
pressionInvocation; | |
2447 EngineTestCase.assertInstanceOf(FunctionExpression, invocation.function); | |
2448 FunctionExpression expression = invocation.function as FunctionExpression; | |
2449 JUnitTestCase.assertNotNull(expression.parameters); | |
2450 JUnitTestCase.assertNotNull(expression.body); | |
2451 ArgumentList list = invocation.argumentList; | |
2452 JUnitTestCase.assertNotNull(list); | |
2453 EngineTestCase.assertSize(1, list.arguments); | |
2454 } | |
2455 void test_parseNonLabeledStatement_null() { | |
2456 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "null;", []); | |
2457 JUnitTestCase.assertNotNull(statement.expression); | |
2458 } | |
2459 void test_parseNonLabeledStatement_startingWithBuiltInIdentifier() { | |
2460 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "library.getName();", []); | |
2461 JUnitTestCase.assertNotNull(statement.expression); | |
2462 } | |
2463 void test_parseNonLabeledStatement_true() { | |
2464 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "true;", []); | |
2465 JUnitTestCase.assertNotNull(statement.expression); | |
2466 } | |
2467 void test_parseNonLabeledStatement_typeCast() { | |
2468 ExpressionStatement statement = ParserTestCase.parse6("parseNonLabeledStatem
ent", "double.NAN as num;", []); | |
2469 JUnitTestCase.assertNotNull(statement.expression); | |
2470 } | |
2471 void test_parseNormalFormalParameter_field_const_noType() { | |
2472 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "const this.a)", []); | |
2473 JUnitTestCase.assertNotNull(parameter.keyword); | |
2474 JUnitTestCase.assertNull(parameter.type); | |
2475 JUnitTestCase.assertNotNull(parameter.identifier); | |
2476 } | |
2477 void test_parseNormalFormalParameter_field_const_type() { | |
2478 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "const A this.a)", []); | |
2479 JUnitTestCase.assertNotNull(parameter.keyword); | |
2480 JUnitTestCase.assertNotNull(parameter.type); | |
2481 JUnitTestCase.assertNotNull(parameter.identifier); | |
2482 } | |
2483 void test_parseNormalFormalParameter_field_final_noType() { | |
2484 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "final this.a)", []); | |
2485 JUnitTestCase.assertNotNull(parameter.keyword); | |
2486 JUnitTestCase.assertNull(parameter.type); | |
2487 JUnitTestCase.assertNotNull(parameter.identifier); | |
2488 } | |
2489 void test_parseNormalFormalParameter_field_final_type() { | |
2490 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "final A this.a)", []); | |
2491 JUnitTestCase.assertNotNull(parameter.keyword); | |
2492 JUnitTestCase.assertNotNull(parameter.type); | |
2493 JUnitTestCase.assertNotNull(parameter.identifier); | |
2494 } | |
2495 void test_parseNormalFormalParameter_field_noType() { | |
2496 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "this.a)", []); | |
2497 JUnitTestCase.assertNull(parameter.keyword); | |
2498 JUnitTestCase.assertNull(parameter.type); | |
2499 JUnitTestCase.assertNotNull(parameter.identifier); | |
2500 } | |
2501 void test_parseNormalFormalParameter_field_type() { | |
2502 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "A this.a)", []); | |
2503 JUnitTestCase.assertNull(parameter.keyword); | |
2504 JUnitTestCase.assertNotNull(parameter.type); | |
2505 JUnitTestCase.assertNotNull(parameter.identifier); | |
2506 } | |
2507 void test_parseNormalFormalParameter_field_var() { | |
2508 FieldFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPar
ameter", "var this.a)", []); | |
2509 JUnitTestCase.assertNotNull(parameter.keyword); | |
2510 JUnitTestCase.assertNull(parameter.type); | |
2511 JUnitTestCase.assertNotNull(parameter.identifier); | |
2512 } | |
2513 void test_parseNormalFormalParameter_function_noType() { | |
2514 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF
ormalParameter", "a())", []); | |
2515 JUnitTestCase.assertNull(parameter.returnType); | |
2516 JUnitTestCase.assertNotNull(parameter.identifier); | |
2517 JUnitTestCase.assertNotNull(parameter.parameters); | |
2518 } | |
2519 void test_parseNormalFormalParameter_function_type() { | |
2520 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF
ormalParameter", "A a())", []); | |
2521 JUnitTestCase.assertNotNull(parameter.returnType); | |
2522 JUnitTestCase.assertNotNull(parameter.identifier); | |
2523 JUnitTestCase.assertNotNull(parameter.parameters); | |
2524 } | |
2525 void test_parseNormalFormalParameter_function_void() { | |
2526 FunctionTypedFormalParameter parameter = ParserTestCase.parse6("parseNormalF
ormalParameter", "void a())", []); | |
2527 JUnitTestCase.assertNotNull(parameter.returnType); | |
2528 JUnitTestCase.assertNotNull(parameter.identifier); | |
2529 JUnitTestCase.assertNotNull(parameter.parameters); | |
2530 } | |
2531 void test_parseNormalFormalParameter_simple_const_noType() { | |
2532 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "const a)", []); | |
2533 JUnitTestCase.assertNotNull(parameter.keyword); | |
2534 JUnitTestCase.assertNull(parameter.type); | |
2535 JUnitTestCase.assertNotNull(parameter.identifier); | |
2536 } | |
2537 void test_parseNormalFormalParameter_simple_const_type() { | |
2538 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "const A a)", []); | |
2539 JUnitTestCase.assertNotNull(parameter.keyword); | |
2540 JUnitTestCase.assertNotNull(parameter.type); | |
2541 JUnitTestCase.assertNotNull(parameter.identifier); | |
2542 } | |
2543 void test_parseNormalFormalParameter_simple_final_noType() { | |
2544 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "final a)", []); | |
2545 JUnitTestCase.assertNotNull(parameter.keyword); | |
2546 JUnitTestCase.assertNull(parameter.type); | |
2547 JUnitTestCase.assertNotNull(parameter.identifier); | |
2548 } | |
2549 void test_parseNormalFormalParameter_simple_final_type() { | |
2550 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "final A a)", []); | |
2551 JUnitTestCase.assertNotNull(parameter.keyword); | |
2552 JUnitTestCase.assertNotNull(parameter.type); | |
2553 JUnitTestCase.assertNotNull(parameter.identifier); | |
2554 } | |
2555 void test_parseNormalFormalParameter_simple_noType() { | |
2556 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "a)", []); | |
2557 JUnitTestCase.assertNull(parameter.keyword); | |
2558 JUnitTestCase.assertNull(parameter.type); | |
2559 JUnitTestCase.assertNotNull(parameter.identifier); | |
2560 } | |
2561 void test_parseNormalFormalParameter_simple_type() { | |
2562 SimpleFormalParameter parameter = ParserTestCase.parse6("parseNormalFormalPa
rameter", "A a)", []); | |
2563 JUnitTestCase.assertNull(parameter.keyword); | |
2564 JUnitTestCase.assertNotNull(parameter.type); | |
2565 JUnitTestCase.assertNotNull(parameter.identifier); | |
2566 } | |
2567 void test_parseOperator() { | |
2568 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
2569 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
2570 MethodDeclaration method = ParserTestCase.parse("parseOperator", <Object> [c
ommentAndMetadata(comment, []), null, returnType], "operator +(A a);"); | |
2571 JUnitTestCase.assertNotNull(method.body); | |
2572 JUnitTestCase.assertEquals(comment, method.documentationComment); | |
2573 JUnitTestCase.assertNull(method.externalKeyword); | |
2574 JUnitTestCase.assertNull(method.modifierKeyword); | |
2575 JUnitTestCase.assertNotNull(method.name); | |
2576 JUnitTestCase.assertNotNull(method.operatorKeyword); | |
2577 JUnitTestCase.assertNotNull(method.parameters); | |
2578 JUnitTestCase.assertNull(method.propertyKeyword); | |
2579 JUnitTestCase.assertEquals(returnType, method.returnType); | |
2580 } | |
2581 void test_parseOptionalReturnType() { | |
2582 } | |
2583 void test_parsePartDirective_part() { | |
2584 PartDirective directive = ParserTestCase.parse("parsePartDirective", <Object
> [emptyCommentAndMetadata()], "part 'lib/lib.dart';"); | |
2585 JUnitTestCase.assertNotNull(directive.partToken); | |
2586 JUnitTestCase.assertNotNull(directive.uri); | |
2587 JUnitTestCase.assertNotNull(directive.semicolon); | |
2588 } | |
2589 void test_parsePartDirective_partOf() { | |
2590 PartOfDirective directive = ParserTestCase.parse("parsePartDirective", <Obje
ct> [emptyCommentAndMetadata()], "part of l;"); | |
2591 JUnitTestCase.assertNotNull(directive.partToken); | |
2592 JUnitTestCase.assertNotNull(directive.ofToken); | |
2593 JUnitTestCase.assertNotNull(directive.libraryName); | |
2594 JUnitTestCase.assertNotNull(directive.semicolon); | |
2595 } | |
2596 void test_parsePostfixExpression_decrement() { | |
2597 PostfixExpression expression = ParserTestCase.parse6("parsePostfixExpression
", "i--", []); | |
2598 JUnitTestCase.assertNotNull(expression.operand); | |
2599 JUnitTestCase.assertNotNull(expression.operator); | |
2600 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); | |
2601 } | |
2602 void test_parsePostfixExpression_increment() { | |
2603 PostfixExpression expression = ParserTestCase.parse6("parsePostfixExpression
", "i++", []); | |
2604 JUnitTestCase.assertNotNull(expression.operand); | |
2605 JUnitTestCase.assertNotNull(expression.operator); | |
2606 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); | |
2607 } | |
2608 void test_parsePostfixExpression_none_indexExpression() { | |
2609 IndexExpression expression = ParserTestCase.parse6("parsePostfixExpression",
"a[0]", []); | |
2610 JUnitTestCase.assertNotNull(expression.array); | |
2611 JUnitTestCase.assertNotNull(expression.index); | |
2612 } | |
2613 void test_parsePostfixExpression_none_methodInvocation() { | |
2614 MethodInvocation expression = ParserTestCase.parse6("parsePostfixExpression"
, "a.m()", []); | |
2615 JUnitTestCase.assertNotNull(expression.target); | |
2616 JUnitTestCase.assertNotNull(expression.methodName); | |
2617 JUnitTestCase.assertNotNull(expression.argumentList); | |
2618 } | |
2619 void test_parsePostfixExpression_none_propertyAccess() { | |
2620 PrefixedIdentifier expression = ParserTestCase.parse6("parsePostfixExpressio
n", "a.b", []); | |
2621 JUnitTestCase.assertNotNull(expression.prefix); | |
2622 JUnitTestCase.assertNotNull(expression.identifier); | |
2623 } | |
2624 void test_parsePrefixedIdentifier_noPrefix() { | |
2625 String lexeme = "bar"; | |
2626 SimpleIdentifier identifier = ParserTestCase.parse6("parsePrefixedIdentifier
", lexeme, []); | |
2627 JUnitTestCase.assertNotNull(identifier.token); | |
2628 JUnitTestCase.assertEquals(lexeme, identifier.name); | |
2629 } | |
2630 void test_parsePrefixedIdentifier_prefix() { | |
2631 String lexeme = "foo.bar"; | |
2632 PrefixedIdentifier identifier = ParserTestCase.parse6("parsePrefixedIdentifi
er", lexeme, []); | |
2633 JUnitTestCase.assertEquals("foo", identifier.prefix.name); | |
2634 JUnitTestCase.assertNotNull(identifier.period); | |
2635 JUnitTestCase.assertEquals("bar", identifier.identifier.name); | |
2636 } | |
2637 void test_parsePrimaryExpression_argumentDefinitionTest() { | |
2638 ArgumentDefinitionTest expression = ParserTestCase.parse6("parseArgumentDefi
nitionTest", "?a", []); | |
2639 JUnitTestCase.assertNotNull(expression.question); | |
2640 JUnitTestCase.assertNotNull(expression.identifier); | |
2641 } | |
2642 void test_parsePrimaryExpression_const() { | |
2643 InstanceCreationExpression expression = ParserTestCase.parse6("parsePrimaryE
xpression", "const A()", []); | |
2644 JUnitTestCase.assertNotNull(expression); | |
2645 } | |
2646 void test_parsePrimaryExpression_double() { | |
2647 String doubleLiteral = "3.2e4"; | |
2648 DoubleLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", doub
leLiteral, []); | |
2649 JUnitTestCase.assertNotNull(literal.literal); | |
2650 JUnitTestCase.assertEquals(double.parse(doubleLiteral), literal.value); | |
2651 } | |
2652 void test_parsePrimaryExpression_false() { | |
2653 BooleanLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "fa
lse", []); | |
2654 JUnitTestCase.assertNotNull(literal.literal); | |
2655 JUnitTestCase.assertFalse(literal.value); | |
2656 } | |
2657 void test_parsePrimaryExpression_function_arguments() { | |
2658 FunctionExpression expression = ParserTestCase.parse6("parsePrimaryExpressio
n", "(int i) => i + 1", []); | |
2659 JUnitTestCase.assertNotNull(expression.parameters); | |
2660 JUnitTestCase.assertNotNull(expression.body); | |
2661 } | |
2662 void test_parsePrimaryExpression_function_noArguments() { | |
2663 FunctionExpression expression = ParserTestCase.parse6("parsePrimaryExpressio
n", "() => 42", []); | |
2664 JUnitTestCase.assertNotNull(expression.parameters); | |
2665 JUnitTestCase.assertNotNull(expression.body); | |
2666 } | |
2667 void test_parsePrimaryExpression_hex() { | |
2668 String hexLiteral = "3F"; | |
2669 IntegerLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "0x
${hexLiteral}", []); | |
2670 JUnitTestCase.assertNotNull(literal.literal); | |
2671 JUnitTestCase.assertEquals(int.parse(hexLiteral, radix: 16), literal.value); | |
2672 } | |
2673 void test_parsePrimaryExpression_identifier() { | |
2674 SimpleIdentifier identifier = ParserTestCase.parse6("parsePrimaryExpression"
, "a", []); | |
2675 JUnitTestCase.assertNotNull(identifier); | |
2676 } | |
2677 void test_parsePrimaryExpression_int() { | |
2678 String intLiteral = "472"; | |
2679 IntegerLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", int
Literal, []); | |
2680 JUnitTestCase.assertNotNull(literal.literal); | |
2681 JUnitTestCase.assertEquals(int.parse(intLiteral), literal.value); | |
2682 } | |
2683 void test_parsePrimaryExpression_listLiteral() { | |
2684 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "[ ]",
[]); | |
2685 JUnitTestCase.assertNotNull(literal); | |
2686 } | |
2687 void test_parsePrimaryExpression_listLiteral_index() { | |
2688 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "[]",
[]); | |
2689 JUnitTestCase.assertNotNull(literal); | |
2690 } | |
2691 void test_parsePrimaryExpression_listLiteral_typed() { | |
2692 ListLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "<A>[
]", []); | |
2693 JUnitTestCase.assertNotNull(literal.typeArguments); | |
2694 EngineTestCase.assertSize(1, literal.typeArguments.arguments); | |
2695 } | |
2696 void test_parsePrimaryExpression_mapLiteral() { | |
2697 MapLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "{}", [
]); | |
2698 JUnitTestCase.assertNotNull(literal); | |
2699 } | |
2700 void test_parsePrimaryExpression_mapLiteral_typed() { | |
2701 MapLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "<A>{}"
, []); | |
2702 JUnitTestCase.assertNotNull(literal.typeArguments); | |
2703 EngineTestCase.assertSize(1, literal.typeArguments.arguments); | |
2704 } | |
2705 void test_parsePrimaryExpression_new() { | |
2706 InstanceCreationExpression expression = ParserTestCase.parse6("parsePrimaryE
xpression", "new A()", []); | |
2707 JUnitTestCase.assertNotNull(expression); | |
2708 } | |
2709 void test_parsePrimaryExpression_null() { | |
2710 NullLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "null"
, []); | |
2711 JUnitTestCase.assertNotNull(literal.literal); | |
2712 } | |
2713 void test_parsePrimaryExpression_parenthesized() { | |
2714 ParenthesizedExpression expression = ParserTestCase.parse6("parsePrimaryExpr
ession", "()", []); | |
2715 JUnitTestCase.assertNotNull(expression); | |
2716 } | |
2717 void test_parsePrimaryExpression_string() { | |
2718 SimpleStringLiteral literal = ParserTestCase.parse6("parsePrimaryExpression"
, "\"string\"", []); | |
2719 JUnitTestCase.assertFalse(literal.isMultiline()); | |
2720 JUnitTestCase.assertEquals("string", literal.value); | |
2721 } | |
2722 void test_parsePrimaryExpression_super() { | |
2723 PropertyAccess propertyAccess = ParserTestCase.parse6("parsePrimaryExpressio
n", "super.x", []); | |
2724 JUnitTestCase.assertTrue(propertyAccess.target is SuperExpression); | |
2725 JUnitTestCase.assertNotNull(propertyAccess.operator); | |
2726 JUnitTestCase.assertEquals(TokenType.PERIOD, propertyAccess.operator.type); | |
2727 JUnitTestCase.assertNotNull(propertyAccess.propertyName); | |
2728 } | |
2729 void test_parsePrimaryExpression_this() { | |
2730 ThisExpression expression = ParserTestCase.parse6("parsePrimaryExpression",
"this", []); | |
2731 JUnitTestCase.assertNotNull(expression.keyword); | |
2732 } | |
2733 void test_parsePrimaryExpression_true() { | |
2734 BooleanLiteral literal = ParserTestCase.parse6("parsePrimaryExpression", "tr
ue", []); | |
2735 JUnitTestCase.assertNotNull(literal.literal); | |
2736 JUnitTestCase.assertTrue(literal.value); | |
2737 } | |
2738 void test_Parser() { | |
2739 JUnitTestCase.assertNotNull(new Parser(null, null)); | |
2740 } | |
2741 void test_parseRedirectingConstructorInvocation_named() { | |
2742 RedirectingConstructorInvocation invocation = ParserTestCase.parse6("parseRe
directingConstructorInvocation", "this.a()", []); | |
2743 JUnitTestCase.assertNotNull(invocation.argumentList); | |
2744 JUnitTestCase.assertNotNull(invocation.constructorName); | |
2745 JUnitTestCase.assertNotNull(invocation.keyword); | |
2746 JUnitTestCase.assertNotNull(invocation.period); | |
2747 } | |
2748 void test_parseRedirectingConstructorInvocation_unnamed() { | |
2749 RedirectingConstructorInvocation invocation = ParserTestCase.parse6("parseRe
directingConstructorInvocation", "this()", []); | |
2750 JUnitTestCase.assertNotNull(invocation.argumentList); | |
2751 JUnitTestCase.assertNull(invocation.constructorName); | |
2752 JUnitTestCase.assertNotNull(invocation.keyword); | |
2753 JUnitTestCase.assertNull(invocation.period); | |
2754 } | |
2755 void test_parseRelationalExpression_as() { | |
2756 AsExpression expression = ParserTestCase.parse6("parseRelationalExpression",
"x as Y", []); | |
2757 JUnitTestCase.assertNotNull(expression.expression); | |
2758 JUnitTestCase.assertNotNull(expression.asOperator); | |
2759 JUnitTestCase.assertNotNull(expression.type); | |
2760 } | |
2761 void test_parseRelationalExpression_is() { | |
2762 IsExpression expression = ParserTestCase.parse6("parseRelationalExpression",
"x is y", []); | |
2763 JUnitTestCase.assertNotNull(expression.expression); | |
2764 JUnitTestCase.assertNotNull(expression.isOperator); | |
2765 JUnitTestCase.assertNull(expression.notOperator); | |
2766 JUnitTestCase.assertNotNull(expression.type); | |
2767 } | |
2768 void test_parseRelationalExpression_isNot() { | |
2769 IsExpression expression = ParserTestCase.parse6("parseRelationalExpression",
"x is! y", []); | |
2770 JUnitTestCase.assertNotNull(expression.expression); | |
2771 JUnitTestCase.assertNotNull(expression.isOperator); | |
2772 JUnitTestCase.assertNotNull(expression.notOperator); | |
2773 JUnitTestCase.assertNotNull(expression.type); | |
2774 } | |
2775 void test_parseRelationalExpression_normal() { | |
2776 BinaryExpression expression = ParserTestCase.parse6("parseRelationalExpressi
on", "x < y", []); | |
2777 JUnitTestCase.assertNotNull(expression.leftOperand); | |
2778 JUnitTestCase.assertNotNull(expression.operator); | |
2779 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); | |
2780 JUnitTestCase.assertNotNull(expression.rightOperand); | |
2781 } | |
2782 void test_parseRelationalExpression_super() { | |
2783 BinaryExpression expression = ParserTestCase.parse6("parseRelationalExpressi
on", "super < y", []); | |
2784 JUnitTestCase.assertNotNull(expression.leftOperand); | |
2785 JUnitTestCase.assertNotNull(expression.operator); | |
2786 JUnitTestCase.assertEquals(TokenType.LT, expression.operator.type); | |
2787 JUnitTestCase.assertNotNull(expression.rightOperand); | |
2788 } | |
2789 void test_parseReturnStatement_noValue() { | |
2790 ReturnStatement statement = ParserTestCase.parse6("parseReturnStatement", "r
eturn;", []); | |
2791 JUnitTestCase.assertNotNull(statement.keyword); | |
2792 JUnitTestCase.assertNull(statement.expression); | |
2793 JUnitTestCase.assertNotNull(statement.semicolon); | |
2794 } | |
2795 void test_parseReturnStatement_value() { | |
2796 ReturnStatement statement = ParserTestCase.parse6("parseReturnStatement", "r
eturn x;", []); | |
2797 JUnitTestCase.assertNotNull(statement.keyword); | |
2798 JUnitTestCase.assertNotNull(statement.expression); | |
2799 JUnitTestCase.assertNotNull(statement.semicolon); | |
2800 } | |
2801 void test_parseReturnType_nonVoid() { | |
2802 TypeName typeName = ParserTestCase.parse6("parseReturnType", "A<B>", []); | |
2803 JUnitTestCase.assertNotNull(typeName.name); | |
2804 JUnitTestCase.assertNotNull(typeName.typeArguments); | |
2805 } | |
2806 void test_parseReturnType_void() { | |
2807 TypeName typeName = ParserTestCase.parse6("parseReturnType", "void", []); | |
2808 JUnitTestCase.assertNotNull(typeName.name); | |
2809 JUnitTestCase.assertNull(typeName.typeArguments); | |
2810 } | |
2811 void test_parseSetter_nonStatic() { | |
2812 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
2813 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
2814 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com
mentAndMetadata(comment, []), null, null, returnType], "set a(var x);"); | |
2815 JUnitTestCase.assertNotNull(method.body); | |
2816 JUnitTestCase.assertEquals(comment, method.documentationComment); | |
2817 JUnitTestCase.assertNull(method.externalKeyword); | |
2818 JUnitTestCase.assertNull(method.modifierKeyword); | |
2819 JUnitTestCase.assertNotNull(method.name); | |
2820 JUnitTestCase.assertNull(method.operatorKeyword); | |
2821 JUnitTestCase.assertNotNull(method.parameters); | |
2822 JUnitTestCase.assertNotNull(method.propertyKeyword); | |
2823 JUnitTestCase.assertEquals(returnType, method.returnType); | |
2824 } | |
2825 void test_parseSetter_static() { | |
2826 Comment comment = Comment.createDocumentationComment(new List<Token>(0)); | |
2827 Token staticKeyword = TokenFactory.token(Keyword.STATIC); | |
2828 TypeName returnType = new TypeName.full(new SimpleIdentifier.full(null), nul
l); | |
2829 MethodDeclaration method = ParserTestCase.parse("parseSetter", <Object> [com
mentAndMetadata(comment, []), null, staticKeyword, returnType], "set a(var x) {}
"); | |
2830 JUnitTestCase.assertNotNull(method.body); | |
2831 JUnitTestCase.assertEquals(comment, method.documentationComment); | |
2832 JUnitTestCase.assertNull(method.externalKeyword); | |
2833 JUnitTestCase.assertEquals(staticKeyword, method.modifierKeyword); | |
2834 JUnitTestCase.assertNotNull(method.name); | |
2835 JUnitTestCase.assertNull(method.operatorKeyword); | |
2836 JUnitTestCase.assertNotNull(method.parameters); | |
2837 JUnitTestCase.assertNotNull(method.propertyKeyword); | |
2838 JUnitTestCase.assertEquals(returnType, method.returnType); | |
2839 } | |
2840 void test_parseShiftExpression_normal() { | |
2841 BinaryExpression expression = ParserTestCase.parse6("parseShiftExpression",
"x << y", []); | |
2842 JUnitTestCase.assertNotNull(expression.leftOperand); | |
2843 JUnitTestCase.assertNotNull(expression.operator); | |
2844 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); | |
2845 JUnitTestCase.assertNotNull(expression.rightOperand); | |
2846 } | |
2847 void test_parseShiftExpression_super() { | |
2848 BinaryExpression expression = ParserTestCase.parse6("parseShiftExpression",
"super << y", []); | |
2849 JUnitTestCase.assertNotNull(expression.leftOperand); | |
2850 JUnitTestCase.assertNotNull(expression.operator); | |
2851 JUnitTestCase.assertEquals(TokenType.LT_LT, expression.operator.type); | |
2852 JUnitTestCase.assertNotNull(expression.rightOperand); | |
2853 } | |
2854 void test_parseSimpleIdentifier_builtInIdentifier() { | |
2855 String lexeme = "as"; | |
2856 SimpleIdentifier identifier = ParserTestCase.parse6("parseSimpleIdentifier",
lexeme, []); | |
2857 JUnitTestCase.assertNotNull(identifier.token); | |
2858 JUnitTestCase.assertEquals(lexeme, identifier.name); | |
2859 } | |
2860 void test_parseSimpleIdentifier_normalIdentifier() { | |
2861 String lexeme = "foo"; | |
2862 SimpleIdentifier identifier = ParserTestCase.parse6("parseSimpleIdentifier",
lexeme, []); | |
2863 JUnitTestCase.assertNotNull(identifier.token); | |
2864 JUnitTestCase.assertEquals(lexeme, identifier.name); | |
2865 } | |
2866 void test_parseSimpleIdentifier1_normalIdentifier() { | |
2867 } | |
2868 void test_parseStatement_functionDeclaration() { | |
2869 FunctionDeclarationStatement statement = ParserTestCase.parse6("parseStateme
nt", "int f(a, b) {};", []); | |
2870 JUnitTestCase.assertNotNull(statement.functionDeclaration); | |
2871 } | |
2872 void test_parseStatement_mulipleLabels() { | |
2873 LabeledStatement statement = ParserTestCase.parse6("parseStatement", "l: m:
return x;", []); | |
2874 EngineTestCase.assertSize(2, statement.labels); | |
2875 JUnitTestCase.assertNotNull(statement.statement); | |
2876 } | |
2877 void test_parseStatement_noLabels() { | |
2878 ParserTestCase.parse6("parseStatement", "return x;", []); | |
2879 } | |
2880 void test_parseStatement_singleLabel() { | |
2881 LabeledStatement statement = ParserTestCase.parse6("parseStatement", "l: ret
urn x;", []); | |
2882 EngineTestCase.assertSize(1, statement.labels); | |
2883 JUnitTestCase.assertNotNull(statement.statement); | |
2884 } | |
2885 void test_parseStatements_multiple() { | |
2886 List<Statement> statements = ParserTestCase.parseStatements("return; return;
", 2, []); | |
2887 EngineTestCase.assertSize(2, statements); | |
2888 } | |
2889 void test_parseStatements_single() { | |
2890 List<Statement> statements = ParserTestCase.parseStatements("return;", 1, []
); | |
2891 EngineTestCase.assertSize(1, statements); | |
2892 } | |
2893 void test_parseStringLiteral_adjacent() { | |
2894 AdjacentStrings literal = ParserTestCase.parse6("parseStringLiteral", "'a' '
b'", []); | |
2895 NodeList<StringLiteral> strings2 = literal.strings; | |
2896 EngineTestCase.assertSize(2, strings2); | |
2897 StringLiteral firstString = strings2[0]; | |
2898 StringLiteral secondString = strings2[1]; | |
2899 JUnitTestCase.assertEquals("a", ((firstString as SimpleStringLiteral)).value
); | |
2900 JUnitTestCase.assertEquals("b", ((secondString as SimpleStringLiteral)).valu
e); | |
2901 } | |
2902 void test_parseStringLiteral_interpolated() { | |
2903 StringInterpolation literal = ParserTestCase.parse6("parseStringLiteral", "'
a \${b} c \$this d'", []); | |
2904 NodeList<InterpolationElement> elements2 = literal.elements; | |
2905 EngineTestCase.assertSize(5, elements2); | |
2906 JUnitTestCase.assertTrue(elements2[0] is InterpolationString); | |
2907 JUnitTestCase.assertTrue(elements2[1] is InterpolationExpression); | |
2908 JUnitTestCase.assertTrue(elements2[2] is InterpolationString); | |
2909 JUnitTestCase.assertTrue(elements2[3] is InterpolationExpression); | |
2910 JUnitTestCase.assertTrue(elements2[4] is InterpolationString); | |
2911 } | |
2912 void test_parseStringLiteral_single() { | |
2913 SimpleStringLiteral literal = ParserTestCase.parse6("parseStringLiteral", "'
a'", []); | |
2914 JUnitTestCase.assertNotNull(literal.literal); | |
2915 JUnitTestCase.assertEquals("a", literal.value); | |
2916 } | |
2917 void test_parseSuperConstructorInvocation_named() { | |
2918 SuperConstructorInvocation invocation = ParserTestCase.parse6("parseSuperCon
structorInvocation", "super.a()", []); | |
2919 JUnitTestCase.assertNotNull(invocation.argumentList); | |
2920 JUnitTestCase.assertNotNull(invocation.constructorName); | |
2921 JUnitTestCase.assertNotNull(invocation.keyword); | |
2922 JUnitTestCase.assertNotNull(invocation.period); | |
2923 } | |
2924 void test_parseSuperConstructorInvocation_unnamed() { | |
2925 SuperConstructorInvocation invocation = ParserTestCase.parse6("parseSuperCon
structorInvocation", "super()", []); | |
2926 JUnitTestCase.assertNotNull(invocation.argumentList); | |
2927 JUnitTestCase.assertNull(invocation.constructorName); | |
2928 JUnitTestCase.assertNotNull(invocation.keyword); | |
2929 JUnitTestCase.assertNull(invocation.period); | |
2930 } | |
2931 void test_parseSwitchStatement_case() { | |
2932 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s
witch (a) {case 1: return 'I';}", []); | |
2933 JUnitTestCase.assertNotNull(statement.keyword); | |
2934 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
2935 JUnitTestCase.assertNotNull(statement.expression); | |
2936 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
2937 JUnitTestCase.assertNotNull(statement.leftBracket); | |
2938 EngineTestCase.assertSize(1, statement.members); | |
2939 JUnitTestCase.assertNotNull(statement.rightBracket); | |
2940 } | |
2941 void test_parseSwitchStatement_empty() { | |
2942 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s
witch (a) {}", []); | |
2943 JUnitTestCase.assertNotNull(statement.keyword); | |
2944 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
2945 JUnitTestCase.assertNotNull(statement.expression); | |
2946 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
2947 JUnitTestCase.assertNotNull(statement.leftBracket); | |
2948 EngineTestCase.assertSize(0, statement.members); | |
2949 JUnitTestCase.assertNotNull(statement.rightBracket); | |
2950 } | |
2951 void test_parseSwitchStatement_labeledCase() { | |
2952 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s
witch (a) {l1: l2: l3: case(1):}", []); | |
2953 JUnitTestCase.assertNotNull(statement.keyword); | |
2954 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
2955 JUnitTestCase.assertNotNull(statement.expression); | |
2956 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
2957 JUnitTestCase.assertNotNull(statement.leftBracket); | |
2958 EngineTestCase.assertSize(1, statement.members); | |
2959 EngineTestCase.assertSize(3, statement.members[0].labels); | |
2960 JUnitTestCase.assertNotNull(statement.rightBracket); | |
2961 } | |
2962 void test_parseSwitchStatement_labeledStatementInCase() { | |
2963 SwitchStatement statement = ParserTestCase.parse6("parseSwitchStatement", "s
witch (a) {case 0: f(); l1: g(); break;}", []); | |
2964 JUnitTestCase.assertNotNull(statement.keyword); | |
2965 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
2966 JUnitTestCase.assertNotNull(statement.expression); | |
2967 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
2968 JUnitTestCase.assertNotNull(statement.leftBracket); | |
2969 EngineTestCase.assertSize(1, statement.members); | |
2970 EngineTestCase.assertSize(3, statement.members[0].statements); | |
2971 JUnitTestCase.assertNotNull(statement.rightBracket); | |
2972 } | |
2973 void test_parseThrowExpression_expression() { | |
2974 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpression", "t
hrow x;", []); | |
2975 JUnitTestCase.assertNotNull(statement.keyword); | |
2976 JUnitTestCase.assertNotNull(statement.expression); | |
2977 } | |
2978 void test_parseThrowExpression_noExpression() { | |
2979 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpression", "t
hrow;", []); | |
2980 JUnitTestCase.assertNotNull(statement.keyword); | |
2981 JUnitTestCase.assertNull(statement.expression); | |
2982 } | |
2983 void test_parseThrowExpressionWithoutCascade_expression() { | |
2984 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpressionWitho
utCascade", "throw x;", []); | |
2985 JUnitTestCase.assertNotNull(statement.keyword); | |
2986 JUnitTestCase.assertNotNull(statement.expression); | |
2987 } | |
2988 void test_parseThrowExpressionWithoutCascade_noExpression() { | |
2989 ThrowExpression statement = ParserTestCase.parse6("parseThrowExpressionWitho
utCascade", "throw;", []); | |
2990 JUnitTestCase.assertNotNull(statement.keyword); | |
2991 JUnitTestCase.assertNull(statement.expression); | |
2992 } | |
2993 void test_parseTryStatement_catch() { | |
2994 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
catch (e) {}", []); | |
2995 JUnitTestCase.assertNotNull(statement.tryKeyword); | |
2996 JUnitTestCase.assertNotNull(statement.body); | |
2997 NodeList<CatchClause> catchClauses2 = statement.catchClauses; | |
2998 EngineTestCase.assertSize(1, catchClauses2); | |
2999 CatchClause clause = catchClauses2[0]; | |
3000 JUnitTestCase.assertNull(clause.onKeyword); | |
3001 JUnitTestCase.assertNull(clause.exceptionType); | |
3002 JUnitTestCase.assertNotNull(clause.catchKeyword); | |
3003 JUnitTestCase.assertNotNull(clause.exceptionParameter); | |
3004 JUnitTestCase.assertNull(clause.comma); | |
3005 JUnitTestCase.assertNull(clause.stackTraceParameter); | |
3006 JUnitTestCase.assertNotNull(clause.body); | |
3007 JUnitTestCase.assertNull(statement.finallyKeyword); | |
3008 JUnitTestCase.assertNull(statement.finallyClause); | |
3009 } | |
3010 void test_parseTryStatement_catch_finally() { | |
3011 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
catch (e, s) {} finally {}", []); | |
3012 JUnitTestCase.assertNotNull(statement.tryKeyword); | |
3013 JUnitTestCase.assertNotNull(statement.body); | |
3014 NodeList<CatchClause> catchClauses3 = statement.catchClauses; | |
3015 EngineTestCase.assertSize(1, catchClauses3); | |
3016 CatchClause clause = catchClauses3[0]; | |
3017 JUnitTestCase.assertNull(clause.onKeyword); | |
3018 JUnitTestCase.assertNull(clause.exceptionType); | |
3019 JUnitTestCase.assertNotNull(clause.catchKeyword); | |
3020 JUnitTestCase.assertNotNull(clause.exceptionParameter); | |
3021 JUnitTestCase.assertNotNull(clause.comma); | |
3022 JUnitTestCase.assertNotNull(clause.stackTraceParameter); | |
3023 JUnitTestCase.assertNotNull(clause.body); | |
3024 JUnitTestCase.assertNotNull(statement.finallyKeyword); | |
3025 JUnitTestCase.assertNotNull(statement.finallyClause); | |
3026 } | |
3027 void test_parseTryStatement_finally() { | |
3028 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
finally {}", []); | |
3029 JUnitTestCase.assertNotNull(statement.tryKeyword); | |
3030 JUnitTestCase.assertNotNull(statement.body); | |
3031 EngineTestCase.assertSize(0, statement.catchClauses); | |
3032 JUnitTestCase.assertNotNull(statement.finallyKeyword); | |
3033 JUnitTestCase.assertNotNull(statement.finallyClause); | |
3034 } | |
3035 void test_parseTryStatement_multiple() { | |
3036 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
on NPE catch (e) {} on Error {} catch (e) {}", []); | |
3037 JUnitTestCase.assertNotNull(statement.tryKeyword); | |
3038 JUnitTestCase.assertNotNull(statement.body); | |
3039 EngineTestCase.assertSize(3, statement.catchClauses); | |
3040 JUnitTestCase.assertNull(statement.finallyKeyword); | |
3041 JUnitTestCase.assertNull(statement.finallyClause); | |
3042 } | |
3043 void test_parseTryStatement_on() { | |
3044 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
on Error {}", []); | |
3045 JUnitTestCase.assertNotNull(statement.tryKeyword); | |
3046 JUnitTestCase.assertNotNull(statement.body); | |
3047 NodeList<CatchClause> catchClauses4 = statement.catchClauses; | |
3048 EngineTestCase.assertSize(1, catchClauses4); | |
3049 CatchClause clause = catchClauses4[0]; | |
3050 JUnitTestCase.assertNotNull(clause.onKeyword); | |
3051 JUnitTestCase.assertNotNull(clause.exceptionType); | |
3052 JUnitTestCase.assertNull(clause.catchKeyword); | |
3053 JUnitTestCase.assertNull(clause.exceptionParameter); | |
3054 JUnitTestCase.assertNull(clause.comma); | |
3055 JUnitTestCase.assertNull(clause.stackTraceParameter); | |
3056 JUnitTestCase.assertNotNull(clause.body); | |
3057 JUnitTestCase.assertNull(statement.finallyKeyword); | |
3058 JUnitTestCase.assertNull(statement.finallyClause); | |
3059 } | |
3060 void test_parseTryStatement_on_catch() { | |
3061 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
on Error catch (e, s) {}", []); | |
3062 JUnitTestCase.assertNotNull(statement.tryKeyword); | |
3063 JUnitTestCase.assertNotNull(statement.body); | |
3064 NodeList<CatchClause> catchClauses5 = statement.catchClauses; | |
3065 EngineTestCase.assertSize(1, catchClauses5); | |
3066 CatchClause clause = catchClauses5[0]; | |
3067 JUnitTestCase.assertNotNull(clause.onKeyword); | |
3068 JUnitTestCase.assertNotNull(clause.exceptionType); | |
3069 JUnitTestCase.assertNotNull(clause.catchKeyword); | |
3070 JUnitTestCase.assertNotNull(clause.exceptionParameter); | |
3071 JUnitTestCase.assertNotNull(clause.comma); | |
3072 JUnitTestCase.assertNotNull(clause.stackTraceParameter); | |
3073 JUnitTestCase.assertNotNull(clause.body); | |
3074 JUnitTestCase.assertNull(statement.finallyKeyword); | |
3075 JUnitTestCase.assertNull(statement.finallyClause); | |
3076 } | |
3077 void test_parseTryStatement_on_catch_finally() { | |
3078 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}
on Error catch (e, s) {} finally {}", []); | |
3079 JUnitTestCase.assertNotNull(statement.tryKeyword); | |
3080 JUnitTestCase.assertNotNull(statement.body); | |
3081 NodeList<CatchClause> catchClauses6 = statement.catchClauses; | |
3082 EngineTestCase.assertSize(1, catchClauses6); | |
3083 CatchClause clause = catchClauses6[0]; | |
3084 JUnitTestCase.assertNotNull(clause.onKeyword); | |
3085 JUnitTestCase.assertNotNull(clause.exceptionType); | |
3086 JUnitTestCase.assertNotNull(clause.catchKeyword); | |
3087 JUnitTestCase.assertNotNull(clause.exceptionParameter); | |
3088 JUnitTestCase.assertNotNull(clause.comma); | |
3089 JUnitTestCase.assertNotNull(clause.stackTraceParameter); | |
3090 JUnitTestCase.assertNotNull(clause.body); | |
3091 JUnitTestCase.assertNotNull(statement.finallyKeyword); | |
3092 JUnitTestCase.assertNotNull(statement.finallyClause); | |
3093 } | |
3094 void test_parseTypeAlias_class_implementsC() { | |
3095 ClassTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object> [
emptyCommentAndMetadata()], "typedef A = Object with B implements C;"); | |
3096 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
3097 JUnitTestCase.assertNotNull(typeAlias.name); | |
3098 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
3099 JUnitTestCase.assertNotNull(typeAlias.withClause); | |
3100 JUnitTestCase.assertNotNull(typeAlias.implementsClause); | |
3101 JUnitTestCase.assertNotNull(typeAlias.implementsClause.keyword); | |
3102 JUnitTestCase.assertEquals(1, typeAlias.implementsClause.interfaces.length); | |
3103 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
3104 } | |
3105 void test_parseTypeAlias_class_withB() { | |
3106 ClassTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object> [
emptyCommentAndMetadata()], "typedef A = Object with B;"); | |
3107 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
3108 JUnitTestCase.assertNotNull(typeAlias.name); | |
3109 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
3110 JUnitTestCase.assertNotNull(typeAlias.withClause); | |
3111 JUnitTestCase.assertNotNull(typeAlias.withClause.withKeyword); | |
3112 JUnitTestCase.assertEquals(1, typeAlias.withClause.mixinTypes.length); | |
3113 JUnitTestCase.assertNull(typeAlias.implementsClause); | |
3114 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
3115 } | |
3116 void test_parseTypeAlias_function_noParameters() { | |
3117 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef bool F();"); | |
3118 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
3119 JUnitTestCase.assertNotNull(typeAlias.name); | |
3120 JUnitTestCase.assertNotNull(typeAlias.parameters); | |
3121 JUnitTestCase.assertNotNull(typeAlias.returnType); | |
3122 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
3123 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
3124 } | |
3125 void test_parseTypeAlias_function_noReturnType() { | |
3126 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef F();"); | |
3127 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
3128 JUnitTestCase.assertNotNull(typeAlias.name); | |
3129 JUnitTestCase.assertNotNull(typeAlias.parameters); | |
3130 JUnitTestCase.assertNull(typeAlias.returnType); | |
3131 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
3132 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
3133 } | |
3134 void test_parseTypeAlias_function_parameterizedReturnType() { | |
3135 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef A<B> F();"); | |
3136 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
3137 JUnitTestCase.assertNotNull(typeAlias.name); | |
3138 JUnitTestCase.assertNotNull(typeAlias.parameters); | |
3139 JUnitTestCase.assertNotNull(typeAlias.returnType); | |
3140 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
3141 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
3142 } | |
3143 void test_parseTypeAlias_function_parameters() { | |
3144 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef bool F(Object value);"); | |
3145 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
3146 JUnitTestCase.assertNotNull(typeAlias.name); | |
3147 JUnitTestCase.assertNotNull(typeAlias.parameters); | |
3148 JUnitTestCase.assertNotNull(typeAlias.returnType); | |
3149 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
3150 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
3151 } | |
3152 void test_parseTypeAlias_function_typeParameters() { | |
3153 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef bool F<E>();"); | |
3154 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
3155 JUnitTestCase.assertNotNull(typeAlias.name); | |
3156 JUnitTestCase.assertNotNull(typeAlias.parameters); | |
3157 JUnitTestCase.assertNotNull(typeAlias.returnType); | |
3158 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
3159 JUnitTestCase.assertNotNull(typeAlias.typeParameters); | |
3160 } | |
3161 void test_parseTypeAlias_function_voidReturnType() { | |
3162 FunctionTypeAlias typeAlias = ParserTestCase.parse("parseTypeAlias", <Object
> [emptyCommentAndMetadata()], "typedef void F();"); | |
3163 JUnitTestCase.assertNotNull(typeAlias.keyword); | |
3164 JUnitTestCase.assertNotNull(typeAlias.name); | |
3165 JUnitTestCase.assertNotNull(typeAlias.parameters); | |
3166 JUnitTestCase.assertNotNull(typeAlias.returnType); | |
3167 JUnitTestCase.assertNotNull(typeAlias.semicolon); | |
3168 JUnitTestCase.assertNull(typeAlias.typeParameters); | |
3169 } | |
3170 void test_parseTypeArgumentList_multiple() { | |
3171 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList
", "<int, int, int>", []); | |
3172 JUnitTestCase.assertNotNull(argumentList.leftBracket); | |
3173 EngineTestCase.assertSize(3, argumentList.arguments); | |
3174 JUnitTestCase.assertNotNull(argumentList.rightBracket); | |
3175 } | |
3176 void test_parseTypeArgumentList_nested() { | |
3177 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList
", "<A<B>>", []); | |
3178 JUnitTestCase.assertNotNull(argumentList.leftBracket); | |
3179 EngineTestCase.assertSize(1, argumentList.arguments); | |
3180 TypeName argument = argumentList.arguments[0]; | |
3181 JUnitTestCase.assertNotNull(argument); | |
3182 TypeArgumentList innerList = argument.typeArguments; | |
3183 JUnitTestCase.assertNotNull(innerList); | |
3184 EngineTestCase.assertSize(1, innerList.arguments); | |
3185 JUnitTestCase.assertNotNull(argumentList.rightBracket); | |
3186 } | |
3187 void test_parseTypeArgumentList_single() { | |
3188 TypeArgumentList argumentList = ParserTestCase.parse6("parseTypeArgumentList
", "<int>", []); | |
3189 JUnitTestCase.assertNotNull(argumentList.leftBracket); | |
3190 EngineTestCase.assertSize(1, argumentList.arguments); | |
3191 JUnitTestCase.assertNotNull(argumentList.rightBracket); | |
3192 } | |
3193 void test_parseTypeName_parameterized() { | |
3194 TypeName typeName = ParserTestCase.parse6("parseTypeName", "List<int>", []); | |
3195 JUnitTestCase.assertNotNull(typeName.name); | |
3196 JUnitTestCase.assertNotNull(typeName.typeArguments); | |
3197 } | |
3198 void test_parseTypeName_simple() { | |
3199 TypeName typeName = ParserTestCase.parse6("parseTypeName", "int", []); | |
3200 JUnitTestCase.assertNotNull(typeName.name); | |
3201 JUnitTestCase.assertNull(typeName.typeArguments); | |
3202 } | |
3203 void test_parseTypeParameter_bounded() { | |
3204 TypeParameter parameter = ParserTestCase.parse6("parseTypeParameter", "A ext
ends B", []); | |
3205 JUnitTestCase.assertNotNull(parameter.bound); | |
3206 JUnitTestCase.assertNotNull(parameter.keyword); | |
3207 JUnitTestCase.assertNotNull(parameter.name); | |
3208 } | |
3209 void test_parseTypeParameter_simple() { | |
3210 TypeParameter parameter = ParserTestCase.parse6("parseTypeParameter", "A", [
]); | |
3211 JUnitTestCase.assertNull(parameter.bound); | |
3212 JUnitTestCase.assertNull(parameter.keyword); | |
3213 JUnitTestCase.assertNotNull(parameter.name); | |
3214 } | |
3215 void test_parseTypeParameterList_multiple() { | |
3216 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL
ist", "<A, B extends C, D>", []); | |
3217 JUnitTestCase.assertNotNull(parameterList.leftBracket); | |
3218 JUnitTestCase.assertNotNull(parameterList.rightBracket); | |
3219 EngineTestCase.assertSize(3, parameterList.typeParameters); | |
3220 } | |
3221 void test_parseTypeParameterList_parameterizedWithTrailingEquals() { | |
3222 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL
ist", "<A extends B<E>>=", []); | |
3223 JUnitTestCase.assertNotNull(parameterList.leftBracket); | |
3224 JUnitTestCase.assertNotNull(parameterList.rightBracket); | |
3225 EngineTestCase.assertSize(1, parameterList.typeParameters); | |
3226 } | |
3227 void test_parseTypeParameterList_single() { | |
3228 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL
ist", "<A>", []); | |
3229 JUnitTestCase.assertNotNull(parameterList.leftBracket); | |
3230 JUnitTestCase.assertNotNull(parameterList.rightBracket); | |
3231 EngineTestCase.assertSize(1, parameterList.typeParameters); | |
3232 } | |
3233 void test_parseTypeParameterList_withTrailingEquals() { | |
3234 TypeParameterList parameterList = ParserTestCase.parse6("parseTypeParameterL
ist", "<A>=", []); | |
3235 JUnitTestCase.assertNotNull(parameterList.leftBracket); | |
3236 JUnitTestCase.assertNotNull(parameterList.rightBracket); | |
3237 EngineTestCase.assertSize(1, parameterList.typeParameters); | |
3238 } | |
3239 void test_parseUnaryExpression_decrement_normal() { | |
3240 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"--x", []); | |
3241 JUnitTestCase.assertNotNull(expression.operator); | |
3242 JUnitTestCase.assertEquals(TokenType.MINUS_MINUS, expression.operator.type); | |
3243 JUnitTestCase.assertNotNull(expression.operand); | |
3244 } | |
3245 void test_parseUnaryExpression_decrement_super() { | |
3246 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"--super", []); | |
3247 JUnitTestCase.assertNotNull(expression.operator); | |
3248 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | |
3249 Expression innerExpression = expression.operand; | |
3250 JUnitTestCase.assertNotNull(innerExpression); | |
3251 JUnitTestCase.assertTrue(innerExpression is PrefixExpression); | |
3252 PrefixExpression operand = innerExpression as PrefixExpression; | |
3253 JUnitTestCase.assertNotNull(operand.operator); | |
3254 JUnitTestCase.assertEquals(TokenType.MINUS, operand.operator.type); | |
3255 JUnitTestCase.assertNotNull(operand.operand); | |
3256 } | |
3257 void test_parseUnaryExpression_increment_normal() { | |
3258 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"++x", []); | |
3259 JUnitTestCase.assertNotNull(expression.operator); | |
3260 JUnitTestCase.assertEquals(TokenType.PLUS_PLUS, expression.operator.type); | |
3261 JUnitTestCase.assertNotNull(expression.operand); | |
3262 } | |
3263 void test_parseUnaryExpression_minus_normal() { | |
3264 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"-x", []); | |
3265 JUnitTestCase.assertNotNull(expression.operator); | |
3266 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | |
3267 JUnitTestCase.assertNotNull(expression.operand); | |
3268 } | |
3269 void test_parseUnaryExpression_minus_super() { | |
3270 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"-super", []); | |
3271 JUnitTestCase.assertNotNull(expression.operator); | |
3272 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | |
3273 JUnitTestCase.assertNotNull(expression.operand); | |
3274 } | |
3275 void test_parseUnaryExpression_not_normal() { | |
3276 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"!x", []); | |
3277 JUnitTestCase.assertNotNull(expression.operator); | |
3278 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); | |
3279 JUnitTestCase.assertNotNull(expression.operand); | |
3280 } | |
3281 void test_parseUnaryExpression_not_super() { | |
3282 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"!super", []); | |
3283 JUnitTestCase.assertNotNull(expression.operator); | |
3284 JUnitTestCase.assertEquals(TokenType.BANG, expression.operator.type); | |
3285 JUnitTestCase.assertNotNull(expression.operand); | |
3286 } | |
3287 void test_parseUnaryExpression_tilda_normal() { | |
3288 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"~x", []); | |
3289 JUnitTestCase.assertNotNull(expression.operator); | |
3290 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); | |
3291 JUnitTestCase.assertNotNull(expression.operand); | |
3292 } | |
3293 void test_parseUnaryExpression_tilda_super() { | |
3294 PrefixExpression expression = ParserTestCase.parse6("parseUnaryExpression",
"~super", []); | |
3295 JUnitTestCase.assertNotNull(expression.operator); | |
3296 JUnitTestCase.assertEquals(TokenType.TILDE, expression.operator.type); | |
3297 JUnitTestCase.assertNotNull(expression.operand); | |
3298 } | |
3299 void test_parseVariableDeclaration_equals() { | |
3300 VariableDeclaration declaration = ParserTestCase.parse6("parseVariableDeclar
ation", "a = b", []); | |
3301 JUnitTestCase.assertNotNull(declaration.name); | |
3302 JUnitTestCase.assertNotNull(declaration.equals); | |
3303 JUnitTestCase.assertNotNull(declaration.initializer); | |
3304 } | |
3305 void test_parseVariableDeclaration_noEquals() { | |
3306 VariableDeclaration declaration = ParserTestCase.parse6("parseVariableDeclar
ation", "a", []); | |
3307 JUnitTestCase.assertNotNull(declaration.name); | |
3308 JUnitTestCase.assertNull(declaration.equals); | |
3309 JUnitTestCase.assertNull(declaration.initializer); | |
3310 } | |
3311 void test_parseVariableDeclarationList_const_noType() { | |
3312 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "const a", []); | |
3313 JUnitTestCase.assertNotNull(declarationList.keyword); | |
3314 JUnitTestCase.assertNull(declarationList.type); | |
3315 EngineTestCase.assertSize(1, declarationList.variables); | |
3316 } | |
3317 void test_parseVariableDeclarationList_const_type() { | |
3318 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "const A a", []); | |
3319 JUnitTestCase.assertNotNull(declarationList.keyword); | |
3320 JUnitTestCase.assertNotNull(declarationList.type); | |
3321 EngineTestCase.assertSize(1, declarationList.variables); | |
3322 } | |
3323 void test_parseVariableDeclarationList_final_noType() { | |
3324 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "final a", []); | |
3325 JUnitTestCase.assertNotNull(declarationList.keyword); | |
3326 JUnitTestCase.assertNull(declarationList.type); | |
3327 EngineTestCase.assertSize(1, declarationList.variables); | |
3328 } | |
3329 void test_parseVariableDeclarationList_final_type() { | |
3330 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "final A a", []); | |
3331 JUnitTestCase.assertNotNull(declarationList.keyword); | |
3332 JUnitTestCase.assertNotNull(declarationList.type); | |
3333 EngineTestCase.assertSize(1, declarationList.variables); | |
3334 } | |
3335 void test_parseVariableDeclarationList_type_multiple() { | |
3336 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "A a, b, c", []); | |
3337 JUnitTestCase.assertNull(declarationList.keyword); | |
3338 JUnitTestCase.assertNotNull(declarationList.type); | |
3339 EngineTestCase.assertSize(3, declarationList.variables); | |
3340 } | |
3341 void test_parseVariableDeclarationList_type_single() { | |
3342 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "A a", []); | |
3343 JUnitTestCase.assertNull(declarationList.keyword); | |
3344 JUnitTestCase.assertNotNull(declarationList.type); | |
3345 EngineTestCase.assertSize(1, declarationList.variables); | |
3346 } | |
3347 void test_parseVariableDeclarationList_var_multiple() { | |
3348 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "var a, b, c", []); | |
3349 JUnitTestCase.assertNotNull(declarationList.keyword); | |
3350 JUnitTestCase.assertNull(declarationList.type); | |
3351 EngineTestCase.assertSize(3, declarationList.variables); | |
3352 } | |
3353 void test_parseVariableDeclarationList_var_single() { | |
3354 VariableDeclarationList declarationList = ParserTestCase.parse6("parseVariab
leDeclarationList", "var a", []); | |
3355 JUnitTestCase.assertNotNull(declarationList.keyword); | |
3356 JUnitTestCase.assertNull(declarationList.type); | |
3357 EngineTestCase.assertSize(1, declarationList.variables); | |
3358 } | |
3359 void test_parseVariableDeclarationList2_type() { | |
3360 TypeName type = new TypeName.full(new SimpleIdentifier.full(null), null); | |
3361 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [null, type], "a"); | |
3362 JUnitTestCase.assertNull(declarationList.keyword); | |
3363 JUnitTestCase.assertEquals(type, declarationList.type); | |
3364 EngineTestCase.assertSize(1, declarationList.variables); | |
3365 } | |
3366 void test_parseVariableDeclarationList2_var() { | |
3367 Token keyword = TokenFactory.token(Keyword.VAR); | |
3368 VariableDeclarationList declarationList = ParserTestCase.parse("parseVariabl
eDeclarationList", <Object> [keyword, null], "a, b, c"); | |
3369 JUnitTestCase.assertEquals(keyword, declarationList.keyword); | |
3370 JUnitTestCase.assertNull(declarationList.type); | |
3371 EngineTestCase.assertSize(3, declarationList.variables); | |
3372 } | |
3373 void test_parseVariableDeclarationStatement_multiple() { | |
3374 VariableDeclarationStatement statement = ParserTestCase.parse6("parseVariabl
eDeclarationStatement", "var x, y, z;", []); | |
3375 JUnitTestCase.assertNotNull(statement.semicolon); | |
3376 VariableDeclarationList variableList = statement.variables; | |
3377 JUnitTestCase.assertNotNull(variableList); | |
3378 EngineTestCase.assertSize(3, variableList.variables); | |
3379 } | |
3380 void test_parseVariableDeclarationStatement_single() { | |
3381 VariableDeclarationStatement statement = ParserTestCase.parse6("parseVariabl
eDeclarationStatement", "var x;", []); | |
3382 JUnitTestCase.assertNotNull(statement.semicolon); | |
3383 VariableDeclarationList variableList = statement.variables; | |
3384 JUnitTestCase.assertNotNull(variableList); | |
3385 EngineTestCase.assertSize(1, variableList.variables); | |
3386 } | |
3387 void test_parseWhileStatement() { | |
3388 WhileStatement statement = ParserTestCase.parse6("parseWhileStatement", "whi
le (x) {}", []); | |
3389 JUnitTestCase.assertNotNull(statement.keyword); | |
3390 JUnitTestCase.assertNotNull(statement.leftParenthesis); | |
3391 JUnitTestCase.assertNotNull(statement.condition); | |
3392 JUnitTestCase.assertNotNull(statement.rightParenthesis); | |
3393 JUnitTestCase.assertNotNull(statement.body); | |
3394 } | |
3395 void test_parseWithClause_multiple() { | |
3396 WithClause clause = ParserTestCase.parse6("parseWithClause", "with A, B, C",
[]); | |
3397 JUnitTestCase.assertNotNull(clause.withKeyword); | |
3398 EngineTestCase.assertSize(3, clause.mixinTypes); | |
3399 } | |
3400 void test_parseWithClause_single() { | |
3401 WithClause clause = ParserTestCase.parse6("parseWithClause", "with M", []); | |
3402 JUnitTestCase.assertNotNull(clause.withKeyword); | |
3403 EngineTestCase.assertSize(1, clause.mixinTypes); | |
3404 } | |
3405 void test_skipPrefixedIdentifier_invalid() { | |
3406 Token following = skip("skipPrefixedIdentifier", "+"); | |
3407 JUnitTestCase.assertNull(following); | |
3408 } | |
3409 void test_skipPrefixedIdentifier_notPrefixed() { | |
3410 Token following = skip("skipPrefixedIdentifier", "a +"); | |
3411 JUnitTestCase.assertNotNull(following); | |
3412 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3413 } | |
3414 void test_skipPrefixedIdentifier_prefixed() { | |
3415 Token following = skip("skipPrefixedIdentifier", "a.b +"); | |
3416 JUnitTestCase.assertNotNull(following); | |
3417 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3418 } | |
3419 void test_skipReturnType_invalid() { | |
3420 Token following = skip("skipReturnType", "+"); | |
3421 JUnitTestCase.assertNull(following); | |
3422 } | |
3423 void test_skipReturnType_type() { | |
3424 Token following = skip("skipReturnType", "C +"); | |
3425 JUnitTestCase.assertNotNull(following); | |
3426 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3427 } | |
3428 void test_skipReturnType_void() { | |
3429 Token following = skip("skipReturnType", "void +"); | |
3430 JUnitTestCase.assertNotNull(following); | |
3431 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3432 } | |
3433 void test_skipSimpleIdentifier_identifier() { | |
3434 Token following = skip("skipSimpleIdentifier", "i +"); | |
3435 JUnitTestCase.assertNotNull(following); | |
3436 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3437 } | |
3438 void test_skipSimpleIdentifier_invalid() { | |
3439 Token following = skip("skipSimpleIdentifier", "9 +"); | |
3440 JUnitTestCase.assertNull(following); | |
3441 } | |
3442 void test_skipSimpleIdentifier_pseudoKeyword() { | |
3443 Token following = skip("skipSimpleIdentifier", "as +"); | |
3444 JUnitTestCase.assertNotNull(following); | |
3445 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3446 } | |
3447 void test_skipStringLiteral_adjacent() { | |
3448 Token following = skip("skipStringLiteral", "'a' 'b' +"); | |
3449 JUnitTestCase.assertNotNull(following); | |
3450 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3451 } | |
3452 void test_skipStringLiteral_interpolated() { | |
3453 Token following = skip("skipStringLiteral", "'a\${b}c' +"); | |
3454 JUnitTestCase.assertNotNull(following); | |
3455 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3456 } | |
3457 void test_skipStringLiteral_invalid() { | |
3458 Token following = skip("skipStringLiteral", "a"); | |
3459 JUnitTestCase.assertNull(following); | |
3460 } | |
3461 void test_skipStringLiteral_single() { | |
3462 Token following = skip("skipStringLiteral", "'a' +"); | |
3463 JUnitTestCase.assertNotNull(following); | |
3464 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3465 } | |
3466 void test_skipTypeArgumentList_invalid() { | |
3467 Token following = skip("skipTypeArgumentList", "+"); | |
3468 JUnitTestCase.assertNull(following); | |
3469 } | |
3470 void test_skipTypeArgumentList_multiple() { | |
3471 Token following = skip("skipTypeArgumentList", "<E, F, G> +"); | |
3472 JUnitTestCase.assertNotNull(following); | |
3473 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3474 } | |
3475 void test_skipTypeArgumentList_single() { | |
3476 Token following = skip("skipTypeArgumentList", "<E> +"); | |
3477 JUnitTestCase.assertNotNull(following); | |
3478 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3479 } | |
3480 void test_skipTypeName_invalid() { | |
3481 Token following = skip("skipTypeName", "+"); | |
3482 JUnitTestCase.assertNull(following); | |
3483 } | |
3484 void test_skipTypeName_parameterized() { | |
3485 Token following = skip("skipTypeName", "C<E<F<G>>> +"); | |
3486 JUnitTestCase.assertNotNull(following); | |
3487 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3488 } | |
3489 void test_skipTypeName_simple() { | |
3490 Token following = skip("skipTypeName", "C +"); | |
3491 JUnitTestCase.assertNotNull(following); | |
3492 JUnitTestCase.assertEquals(TokenType.PLUS, following.type); | |
3493 } | |
3494 /** | |
3495 * Invoke the method {@link Parser#computeStringValue(String)} with the given
argument. | |
3496 * @param lexeme the argument to the method | |
3497 * @return the result of invoking the method | |
3498 * @throws Exception if the method could not be invoked or throws an exception | |
3499 */ | |
3500 String computeStringValue(String lexeme) { | |
3501 AnalysisErrorListener listener = new AnalysisErrorListener_13(); | |
3502 Parser parser = new Parser(null, listener); | |
3503 return invokeParserMethodImpl(parser, "computeStringValue", <Object> [lexeme
], null) as String; | |
3504 } | |
3505 /** | |
3506 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse
r set to the token | |
3507 * stream produced by scanning the given source. | |
3508 * @param source the source to be scanned to produce the token stream being te
sted | |
3509 * @return the result of invoking the method | |
3510 * @throws Exception if the method could not be invoked or throws an exception | |
3511 */ | |
3512 SimpleIdentifier createSyntheticIdentifier() { | |
3513 GatheringErrorListener listener = new GatheringErrorListener(); | |
3514 return ParserTestCase.invokeParserMethod2("createSyntheticIdentifier", "", l
istener); | |
3515 } | |
3516 /** | |
3517 * Invoke the method {@link Parser#createSyntheticIdentifier()} with the parse
r set to the token | |
3518 * stream produced by scanning the given source. | |
3519 * @param source the source to be scanned to produce the token stream being te
sted | |
3520 * @return the result of invoking the method | |
3521 * @throws Exception if the method could not be invoked or throws an exception | |
3522 */ | |
3523 SimpleStringLiteral createSyntheticStringLiteral() { | |
3524 GatheringErrorListener listener = new GatheringErrorListener(); | |
3525 return ParserTestCase.invokeParserMethod2("createSyntheticStringLiteral", ""
, listener); | |
3526 } | |
3527 /** | |
3528 * Invoke the method {@link Parser#isFunctionDeclaration()} with the parser se
t to the token | |
3529 * stream produced by scanning the given source. | |
3530 * @param source the source to be scanned to produce the token stream being te
sted | |
3531 * @return the result of invoking the method | |
3532 * @throws Exception if the method could not be invoked or throws an exception | |
3533 */ | |
3534 bool isFunctionDeclaration(String source) { | |
3535 GatheringErrorListener listener = new GatheringErrorListener(); | |
3536 return ParserTestCase.invokeParserMethod2("isFunctionDeclaration", source, l
istener); | |
3537 } | |
3538 /** | |
3539 * Invoke the method {@link Parser#isFunctionExpression()} with the parser set
to the token stream | |
3540 * produced by scanning the given source. | |
3541 * @param source the source to be scanned to produce the token stream being te
sted | |
3542 * @return the result of invoking the method | |
3543 * @throws Exception if the method could not be invoked or throws an exception | |
3544 */ | |
3545 bool isFunctionExpression(String source) { | |
3546 GatheringErrorListener listener = new GatheringErrorListener(); | |
3547 StringScanner scanner = new StringScanner(null, source, listener); | |
3548 Token tokenStream = scanner.tokenize(); | |
3549 Parser parser = new Parser(null, listener); | |
3550 return invokeParserMethodImpl(parser, "isFunctionExpression", <Object> [toke
nStream], tokenStream) as bool; | |
3551 } | |
3552 /** | |
3553 * Invoke the method {@link Parser#isInitializedVariableDeclaration()} with th
e parser set to the | |
3554 * token stream produced by scanning the given source. | |
3555 * @param source the source to be scanned to produce the token stream being te
sted | |
3556 * @return the result of invoking the method | |
3557 * @throws Exception if the method could not be invoked or throws an exception | |
3558 */ | |
3559 bool isInitializedVariableDeclaration(String source) { | |
3560 GatheringErrorListener listener = new GatheringErrorListener(); | |
3561 return ParserTestCase.invokeParserMethod2("isInitializedVariableDeclaration"
, source, listener); | |
3562 } | |
3563 /** | |
3564 * Invoke the method {@link Parser#isSwitchMember()} with the parser set to th
e token stream | |
3565 * produced by scanning the given source. | |
3566 * @param source the source to be scanned to produce the token stream being te
sted | |
3567 * @return the result of invoking the method | |
3568 * @throws Exception if the method could not be invoked or throws an exception | |
3569 */ | |
3570 bool isSwitchMember(String source) { | |
3571 GatheringErrorListener listener = new GatheringErrorListener(); | |
3572 return ParserTestCase.invokeParserMethod2("isSwitchMember", source, listener
); | |
3573 } | |
3574 /** | |
3575 * Invoke a "skip" method in {@link Parser}. The method is assumed to take a t
oken as it's | |
3576 * parameter and is given the first token in the scanned source. | |
3577 * @param methodName the name of the method that should be invoked | |
3578 * @param source the source to be processed by the method | |
3579 * @return the result of invoking the method | |
3580 * @throws Exception if the method could not be invoked or throws an exception | |
3581 * @throws AssertionFailedError if the result is {@code null} | |
3582 */ | |
3583 Token skip(String methodName, String source) { | |
3584 GatheringErrorListener listener = new GatheringErrorListener(); | |
3585 StringScanner scanner = new StringScanner(null, source, listener); | |
3586 Token tokenStream = scanner.tokenize(); | |
3587 Parser parser = new Parser(null, listener); | |
3588 return invokeParserMethodImpl(parser, methodName, <Object> [tokenStream], to
kenStream) as Token; | |
3589 } | |
3590 static dartSuite() { | |
3591 _ut.group('SimpleParserTest', () { | |
3592 _ut.test('test_Parser', () { | |
3593 final __test = new SimpleParserTest(); | |
3594 runJUnitTest(__test, __test.test_Parser); | |
3595 }); | |
3596 _ut.test('test_computeStringValue_emptyInterpolationPrefix', () { | |
3597 final __test = new SimpleParserTest(); | |
3598 runJUnitTest(__test, __test.test_computeStringValue_emptyInterpolationPr
efix); | |
3599 }); | |
3600 _ut.test('test_computeStringValue_escape_b', () { | |
3601 final __test = new SimpleParserTest(); | |
3602 runJUnitTest(__test, __test.test_computeStringValue_escape_b); | |
3603 }); | |
3604 _ut.test('test_computeStringValue_escape_f', () { | |
3605 final __test = new SimpleParserTest(); | |
3606 runJUnitTest(__test, __test.test_computeStringValue_escape_f); | |
3607 }); | |
3608 _ut.test('test_computeStringValue_escape_n', () { | |
3609 final __test = new SimpleParserTest(); | |
3610 runJUnitTest(__test, __test.test_computeStringValue_escape_n); | |
3611 }); | |
3612 _ut.test('test_computeStringValue_escape_notSpecial', () { | |
3613 final __test = new SimpleParserTest(); | |
3614 runJUnitTest(__test, __test.test_computeStringValue_escape_notSpecial); | |
3615 }); | |
3616 _ut.test('test_computeStringValue_escape_r', () { | |
3617 final __test = new SimpleParserTest(); | |
3618 runJUnitTest(__test, __test.test_computeStringValue_escape_r); | |
3619 }); | |
3620 _ut.test('test_computeStringValue_escape_t', () { | |
3621 final __test = new SimpleParserTest(); | |
3622 runJUnitTest(__test, __test.test_computeStringValue_escape_t); | |
3623 }); | |
3624 _ut.test('test_computeStringValue_escape_u_fixed', () { | |
3625 final __test = new SimpleParserTest(); | |
3626 runJUnitTest(__test, __test.test_computeStringValue_escape_u_fixed); | |
3627 }); | |
3628 _ut.test('test_computeStringValue_escape_u_variable', () { | |
3629 final __test = new SimpleParserTest(); | |
3630 runJUnitTest(__test, __test.test_computeStringValue_escape_u_variable); | |
3631 }); | |
3632 _ut.test('test_computeStringValue_escape_v', () { | |
3633 final __test = new SimpleParserTest(); | |
3634 runJUnitTest(__test, __test.test_computeStringValue_escape_v); | |
3635 }); | |
3636 _ut.test('test_computeStringValue_escape_x', () { | |
3637 final __test = new SimpleParserTest(); | |
3638 runJUnitTest(__test, __test.test_computeStringValue_escape_x); | |
3639 }); | |
3640 _ut.test('test_computeStringValue_noEscape_single', () { | |
3641 final __test = new SimpleParserTest(); | |
3642 runJUnitTest(__test, __test.test_computeStringValue_noEscape_single); | |
3643 }); | |
3644 _ut.test('test_computeStringValue_noEscape_triple', () { | |
3645 final __test = new SimpleParserTest(); | |
3646 runJUnitTest(__test, __test.test_computeStringValue_noEscape_triple); | |
3647 }); | |
3648 _ut.test('test_computeStringValue_raw_single', () { | |
3649 final __test = new SimpleParserTest(); | |
3650 runJUnitTest(__test, __test.test_computeStringValue_raw_single); | |
3651 }); | |
3652 _ut.test('test_computeStringValue_raw_triple', () { | |
3653 final __test = new SimpleParserTest(); | |
3654 runJUnitTest(__test, __test.test_computeStringValue_raw_triple); | |
3655 }); | |
3656 _ut.test('test_computeStringValue_raw_withEscape', () { | |
3657 final __test = new SimpleParserTest(); | |
3658 runJUnitTest(__test, __test.test_computeStringValue_raw_withEscape); | |
3659 }); | |
3660 _ut.test('test_createSyntheticIdentifier', () { | |
3661 final __test = new SimpleParserTest(); | |
3662 runJUnitTest(__test, __test.test_createSyntheticIdentifier); | |
3663 }); | |
3664 _ut.test('test_createSyntheticStringLiteral', () { | |
3665 final __test = new SimpleParserTest(); | |
3666 runJUnitTest(__test, __test.test_createSyntheticStringLiteral); | |
3667 }); | |
3668 _ut.test('test_isFunctionDeclaration_nameButNoReturn_block', () { | |
3669 final __test = new SimpleParserTest(); | |
3670 runJUnitTest(__test, __test.test_isFunctionDeclaration_nameButNoReturn_b
lock); | |
3671 }); | |
3672 _ut.test('test_isFunctionDeclaration_nameButNoReturn_expression', () { | |
3673 final __test = new SimpleParserTest(); | |
3674 runJUnitTest(__test, __test.test_isFunctionDeclaration_nameButNoReturn_e
xpression); | |
3675 }); | |
3676 _ut.test('test_isFunctionDeclaration_normalReturn_block', () { | |
3677 final __test = new SimpleParserTest(); | |
3678 runJUnitTest(__test, __test.test_isFunctionDeclaration_normalReturn_bloc
k); | |
3679 }); | |
3680 _ut.test('test_isFunctionDeclaration_normalReturn_expression', () { | |
3681 final __test = new SimpleParserTest(); | |
3682 runJUnitTest(__test, __test.test_isFunctionDeclaration_normalReturn_expr
ession); | |
3683 }); | |
3684 _ut.test('test_isFunctionDeclaration_voidReturn_block', () { | |
3685 final __test = new SimpleParserTest(); | |
3686 runJUnitTest(__test, __test.test_isFunctionDeclaration_voidReturn_block)
; | |
3687 }); | |
3688 _ut.test('test_isFunctionDeclaration_voidReturn_expression', () { | |
3689 final __test = new SimpleParserTest(); | |
3690 runJUnitTest(__test, __test.test_isFunctionDeclaration_voidReturn_expres
sion); | |
3691 }); | |
3692 _ut.test('test_isFunctionExpression_false_noBody', () { | |
3693 final __test = new SimpleParserTest(); | |
3694 runJUnitTest(__test, __test.test_isFunctionExpression_false_noBody); | |
3695 }); | |
3696 _ut.test('test_isFunctionExpression_false_notParameters', () { | |
3697 final __test = new SimpleParserTest(); | |
3698 runJUnitTest(__test, __test.test_isFunctionExpression_false_notParameter
s); | |
3699 }); | |
3700 _ut.test('test_isFunctionExpression_noName_block', () { | |
3701 final __test = new SimpleParserTest(); | |
3702 runJUnitTest(__test, __test.test_isFunctionExpression_noName_block); | |
3703 }); | |
3704 _ut.test('test_isFunctionExpression_noName_expression', () { | |
3705 final __test = new SimpleParserTest(); | |
3706 runJUnitTest(__test, __test.test_isFunctionExpression_noName_expression)
; | |
3707 }); | |
3708 _ut.test('test_isFunctionExpression_parameter_multiple', () { | |
3709 final __test = new SimpleParserTest(); | |
3710 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_multiple
); | |
3711 }); | |
3712 _ut.test('test_isFunctionExpression_parameter_named', () { | |
3713 final __test = new SimpleParserTest(); | |
3714 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_named); | |
3715 }); | |
3716 _ut.test('test_isFunctionExpression_parameter_optional', () { | |
3717 final __test = new SimpleParserTest(); | |
3718 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_optional
); | |
3719 }); | |
3720 _ut.test('test_isFunctionExpression_parameter_single', () { | |
3721 final __test = new SimpleParserTest(); | |
3722 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_single); | |
3723 }); | |
3724 _ut.test('test_isFunctionExpression_parameter_typed', () { | |
3725 final __test = new SimpleParserTest(); | |
3726 runJUnitTest(__test, __test.test_isFunctionExpression_parameter_typed); | |
3727 }); | |
3728 _ut.test('test_isInitializedVariableDeclaration_assignment', () { | |
3729 final __test = new SimpleParserTest(); | |
3730 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_assign
ment); | |
3731 }); | |
3732 _ut.test('test_isInitializedVariableDeclaration_comparison', () { | |
3733 final __test = new SimpleParserTest(); | |
3734 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_compar
ison); | |
3735 }); | |
3736 _ut.test('test_isInitializedVariableDeclaration_conditional', () { | |
3737 final __test = new SimpleParserTest(); | |
3738 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_condit
ional); | |
3739 }); | |
3740 _ut.test('test_isInitializedVariableDeclaration_const_noType_initialized',
() { | |
3741 final __test = new SimpleParserTest(); | |
3742 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_const_
noType_initialized); | |
3743 }); | |
3744 _ut.test('test_isInitializedVariableDeclaration_const_noType_uninitialized
', () { | |
3745 final __test = new SimpleParserTest(); | |
3746 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_const_
noType_uninitialized); | |
3747 }); | |
3748 _ut.test('test_isInitializedVariableDeclaration_const_simpleType_uninitial
ized', () { | |
3749 final __test = new SimpleParserTest(); | |
3750 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_const_
simpleType_uninitialized); | |
3751 }); | |
3752 _ut.test('test_isInitializedVariableDeclaration_final_noType_initialized',
() { | |
3753 final __test = new SimpleParserTest(); | |
3754 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_final_
noType_initialized); | |
3755 }); | |
3756 _ut.test('test_isInitializedVariableDeclaration_final_noType_uninitialized
', () { | |
3757 final __test = new SimpleParserTest(); | |
3758 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_final_
noType_uninitialized); | |
3759 }); | |
3760 _ut.test('test_isInitializedVariableDeclaration_final_simpleType_initializ
ed', () { | |
3761 final __test = new SimpleParserTest(); | |
3762 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_final_
simpleType_initialized); | |
3763 }); | |
3764 _ut.test('test_isInitializedVariableDeclaration_functionDeclaration_typed'
, () { | |
3765 final __test = new SimpleParserTest(); | |
3766 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_functi
onDeclaration_typed); | |
3767 }); | |
3768 _ut.test('test_isInitializedVariableDeclaration_functionDeclaration_untype
d', () { | |
3769 final __test = new SimpleParserTest(); | |
3770 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_functi
onDeclaration_untyped); | |
3771 }); | |
3772 _ut.test('test_isInitializedVariableDeclaration_noType_initialized', () { | |
3773 final __test = new SimpleParserTest(); | |
3774 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_noType
_initialized); | |
3775 }); | |
3776 _ut.test('test_isInitializedVariableDeclaration_noType_uninitialized', ()
{ | |
3777 final __test = new SimpleParserTest(); | |
3778 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_noType
_uninitialized); | |
3779 }); | |
3780 _ut.test('test_isInitializedVariableDeclaration_parameterizedType_initiali
zed', () { | |
3781 final __test = new SimpleParserTest(); | |
3782 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_parame
terizedType_initialized); | |
3783 }); | |
3784 _ut.test('test_isInitializedVariableDeclaration_parameterizedType_uninitia
lized', () { | |
3785 final __test = new SimpleParserTest(); | |
3786 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_parame
terizedType_uninitialized); | |
3787 }); | |
3788 _ut.test('test_isInitializedVariableDeclaration_simpleType_initialized', (
) { | |
3789 final __test = new SimpleParserTest(); | |
3790 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_simple
Type_initialized); | |
3791 }); | |
3792 _ut.test('test_isInitializedVariableDeclaration_simpleType_uninitialized',
() { | |
3793 final __test = new SimpleParserTest(); | |
3794 runJUnitTest(__test, __test.test_isInitializedVariableDeclaration_simple
Type_uninitialized); | |
3795 }); | |
3796 _ut.test('test_isSwitchMember_case_labeled', () { | |
3797 final __test = new SimpleParserTest(); | |
3798 runJUnitTest(__test, __test.test_isSwitchMember_case_labeled); | |
3799 }); | |
3800 _ut.test('test_isSwitchMember_case_unlabeled', () { | |
3801 final __test = new SimpleParserTest(); | |
3802 runJUnitTest(__test, __test.test_isSwitchMember_case_unlabeled); | |
3803 }); | |
3804 _ut.test('test_isSwitchMember_default_labeled', () { | |
3805 final __test = new SimpleParserTest(); | |
3806 runJUnitTest(__test, __test.test_isSwitchMember_default_labeled); | |
3807 }); | |
3808 _ut.test('test_isSwitchMember_default_unlabeled', () { | |
3809 final __test = new SimpleParserTest(); | |
3810 runJUnitTest(__test, __test.test_isSwitchMember_default_unlabeled); | |
3811 }); | |
3812 _ut.test('test_isSwitchMember_false', () { | |
3813 final __test = new SimpleParserTest(); | |
3814 runJUnitTest(__test, __test.test_isSwitchMember_false); | |
3815 }); | |
3816 _ut.test('test_parseAdditiveExpression_normal', () { | |
3817 final __test = new SimpleParserTest(); | |
3818 runJUnitTest(__test, __test.test_parseAdditiveExpression_normal); | |
3819 }); | |
3820 _ut.test('test_parseAdditiveExpression_super', () { | |
3821 final __test = new SimpleParserTest(); | |
3822 runJUnitTest(__test, __test.test_parseAdditiveExpression_super); | |
3823 }); | |
3824 _ut.test('test_parseAnnotation_n1', () { | |
3825 final __test = new SimpleParserTest(); | |
3826 runJUnitTest(__test, __test.test_parseAnnotation_n1); | |
3827 }); | |
3828 _ut.test('test_parseAnnotation_n1_a', () { | |
3829 final __test = new SimpleParserTest(); | |
3830 runJUnitTest(__test, __test.test_parseAnnotation_n1_a); | |
3831 }); | |
3832 _ut.test('test_parseAnnotation_n2', () { | |
3833 final __test = new SimpleParserTest(); | |
3834 runJUnitTest(__test, __test.test_parseAnnotation_n2); | |
3835 }); | |
3836 _ut.test('test_parseAnnotation_n2_a', () { | |
3837 final __test = new SimpleParserTest(); | |
3838 runJUnitTest(__test, __test.test_parseAnnotation_n2_a); | |
3839 }); | |
3840 _ut.test('test_parseAnnotation_n3', () { | |
3841 final __test = new SimpleParserTest(); | |
3842 runJUnitTest(__test, __test.test_parseAnnotation_n3); | |
3843 }); | |
3844 _ut.test('test_parseAnnotation_n3_a', () { | |
3845 final __test = new SimpleParserTest(); | |
3846 runJUnitTest(__test, __test.test_parseAnnotation_n3_a); | |
3847 }); | |
3848 _ut.test('test_parseArgumentDefinitionTest', () { | |
3849 final __test = new SimpleParserTest(); | |
3850 runJUnitTest(__test, __test.test_parseArgumentDefinitionTest); | |
3851 }); | |
3852 _ut.test('test_parseArgumentList_empty', () { | |
3853 final __test = new SimpleParserTest(); | |
3854 runJUnitTest(__test, __test.test_parseArgumentList_empty); | |
3855 }); | |
3856 _ut.test('test_parseArgumentList_mixed', () { | |
3857 final __test = new SimpleParserTest(); | |
3858 runJUnitTest(__test, __test.test_parseArgumentList_mixed); | |
3859 }); | |
3860 _ut.test('test_parseArgumentList_noNamed', () { | |
3861 final __test = new SimpleParserTest(); | |
3862 runJUnitTest(__test, __test.test_parseArgumentList_noNamed); | |
3863 }); | |
3864 _ut.test('test_parseArgumentList_onlyNamed', () { | |
3865 final __test = new SimpleParserTest(); | |
3866 runJUnitTest(__test, __test.test_parseArgumentList_onlyNamed); | |
3867 }); | |
3868 _ut.test('test_parseArgument_named', () { | |
3869 final __test = new SimpleParserTest(); | |
3870 runJUnitTest(__test, __test.test_parseArgument_named); | |
3871 }); | |
3872 _ut.test('test_parseArgument_unnamed', () { | |
3873 final __test = new SimpleParserTest(); | |
3874 runJUnitTest(__test, __test.test_parseArgument_unnamed); | |
3875 }); | |
3876 _ut.test('test_parseAssertStatement', () { | |
3877 final __test = new SimpleParserTest(); | |
3878 runJUnitTest(__test, __test.test_parseAssertStatement); | |
3879 }); | |
3880 _ut.test('test_parseAssignableExpression_expression_args_dot', () { | |
3881 final __test = new SimpleParserTest(); | |
3882 runJUnitTest(__test, __test.test_parseAssignableExpression_expression_ar
gs_dot); | |
3883 }); | |
3884 _ut.test('test_parseAssignableExpression_expression_dot', () { | |
3885 final __test = new SimpleParserTest(); | |
3886 runJUnitTest(__test, __test.test_parseAssignableExpression_expression_do
t); | |
3887 }); | |
3888 _ut.test('test_parseAssignableExpression_expression_index', () { | |
3889 final __test = new SimpleParserTest(); | |
3890 runJUnitTest(__test, __test.test_parseAssignableExpression_expression_in
dex); | |
3891 }); | |
3892 _ut.test('test_parseAssignableExpression_identifier', () { | |
3893 final __test = new SimpleParserTest(); | |
3894 runJUnitTest(__test, __test.test_parseAssignableExpression_identifier); | |
3895 }); | |
3896 _ut.test('test_parseAssignableExpression_identifier_args_dot', () { | |
3897 final __test = new SimpleParserTest(); | |
3898 runJUnitTest(__test, __test.test_parseAssignableExpression_identifier_ar
gs_dot); | |
3899 }); | |
3900 _ut.test('test_parseAssignableExpression_identifier_dot', () { | |
3901 final __test = new SimpleParserTest(); | |
3902 runJUnitTest(__test, __test.test_parseAssignableExpression_identifier_do
t); | |
3903 }); | |
3904 _ut.test('test_parseAssignableExpression_identifier_index', () { | |
3905 final __test = new SimpleParserTest(); | |
3906 runJUnitTest(__test, __test.test_parseAssignableExpression_identifier_in
dex); | |
3907 }); | |
3908 _ut.test('test_parseAssignableExpression_super_dot', () { | |
3909 final __test = new SimpleParserTest(); | |
3910 runJUnitTest(__test, __test.test_parseAssignableExpression_super_dot); | |
3911 }); | |
3912 _ut.test('test_parseAssignableExpression_super_index', () { | |
3913 final __test = new SimpleParserTest(); | |
3914 runJUnitTest(__test, __test.test_parseAssignableExpression_super_index); | |
3915 }); | |
3916 _ut.test('test_parseAssignableSelector_dot', () { | |
3917 final __test = new SimpleParserTest(); | |
3918 runJUnitTest(__test, __test.test_parseAssignableSelector_dot); | |
3919 }); | |
3920 _ut.test('test_parseAssignableSelector_index', () { | |
3921 final __test = new SimpleParserTest(); | |
3922 runJUnitTest(__test, __test.test_parseAssignableSelector_index); | |
3923 }); | |
3924 _ut.test('test_parseAssignableSelector_none', () { | |
3925 final __test = new SimpleParserTest(); | |
3926 runJUnitTest(__test, __test.test_parseAssignableSelector_none); | |
3927 }); | |
3928 _ut.test('test_parseBitwiseAndExpression_normal', () { | |
3929 final __test = new SimpleParserTest(); | |
3930 runJUnitTest(__test, __test.test_parseBitwiseAndExpression_normal); | |
3931 }); | |
3932 _ut.test('test_parseBitwiseAndExpression_super', () { | |
3933 final __test = new SimpleParserTest(); | |
3934 runJUnitTest(__test, __test.test_parseBitwiseAndExpression_super); | |
3935 }); | |
3936 _ut.test('test_parseBitwiseOrExpression_normal', () { | |
3937 final __test = new SimpleParserTest(); | |
3938 runJUnitTest(__test, __test.test_parseBitwiseOrExpression_normal); | |
3939 }); | |
3940 _ut.test('test_parseBitwiseOrExpression_super', () { | |
3941 final __test = new SimpleParserTest(); | |
3942 runJUnitTest(__test, __test.test_parseBitwiseOrExpression_super); | |
3943 }); | |
3944 _ut.test('test_parseBitwiseXorExpression_normal', () { | |
3945 final __test = new SimpleParserTest(); | |
3946 runJUnitTest(__test, __test.test_parseBitwiseXorExpression_normal); | |
3947 }); | |
3948 _ut.test('test_parseBitwiseXorExpression_super', () { | |
3949 final __test = new SimpleParserTest(); | |
3950 runJUnitTest(__test, __test.test_parseBitwiseXorExpression_super); | |
3951 }); | |
3952 _ut.test('test_parseBlock_empty', () { | |
3953 final __test = new SimpleParserTest(); | |
3954 runJUnitTest(__test, __test.test_parseBlock_empty); | |
3955 }); | |
3956 _ut.test('test_parseBlock_nonEmpty', () { | |
3957 final __test = new SimpleParserTest(); | |
3958 runJUnitTest(__test, __test.test_parseBlock_nonEmpty); | |
3959 }); | |
3960 _ut.test('test_parseBreakStatement_label', () { | |
3961 final __test = new SimpleParserTest(); | |
3962 runJUnitTest(__test, __test.test_parseBreakStatement_label); | |
3963 }); | |
3964 _ut.test('test_parseBreakStatement_noLabel', () { | |
3965 final __test = new SimpleParserTest(); | |
3966 runJUnitTest(__test, __test.test_parseBreakStatement_noLabel); | |
3967 }); | |
3968 _ut.test('test_parseCascadeSection_i', () { | |
3969 final __test = new SimpleParserTest(); | |
3970 runJUnitTest(__test, __test.test_parseCascadeSection_i); | |
3971 }); | |
3972 _ut.test('test_parseCascadeSection_ia', () { | |
3973 final __test = new SimpleParserTest(); | |
3974 runJUnitTest(__test, __test.test_parseCascadeSection_ia); | |
3975 }); | |
3976 _ut.test('test_parseCascadeSection_p', () { | |
3977 final __test = new SimpleParserTest(); | |
3978 runJUnitTest(__test, __test.test_parseCascadeSection_p); | |
3979 }); | |
3980 _ut.test('test_parseCascadeSection_p_assign', () { | |
3981 final __test = new SimpleParserTest(); | |
3982 runJUnitTest(__test, __test.test_parseCascadeSection_p_assign); | |
3983 }); | |
3984 _ut.test('test_parseCascadeSection_p_assign_withCascade', () { | |
3985 final __test = new SimpleParserTest(); | |
3986 runJUnitTest(__test, __test.test_parseCascadeSection_p_assign_withCascad
e); | |
3987 }); | |
3988 _ut.test('test_parseCascadeSection_p_builtIn', () { | |
3989 final __test = new SimpleParserTest(); | |
3990 runJUnitTest(__test, __test.test_parseCascadeSection_p_builtIn); | |
3991 }); | |
3992 _ut.test('test_parseCascadeSection_pa', () { | |
3993 final __test = new SimpleParserTest(); | |
3994 runJUnitTest(__test, __test.test_parseCascadeSection_pa); | |
3995 }); | |
3996 _ut.test('test_parseCascadeSection_paa', () { | |
3997 final __test = new SimpleParserTest(); | |
3998 runJUnitTest(__test, __test.test_parseCascadeSection_paa); | |
3999 }); | |
4000 _ut.test('test_parseCascadeSection_paapaa', () { | |
4001 final __test = new SimpleParserTest(); | |
4002 runJUnitTest(__test, __test.test_parseCascadeSection_paapaa); | |
4003 }); | |
4004 _ut.test('test_parseCascadeSection_pap', () { | |
4005 final __test = new SimpleParserTest(); | |
4006 runJUnitTest(__test, __test.test_parseCascadeSection_pap); | |
4007 }); | |
4008 _ut.test('test_parseClassDeclaration_abstract', () { | |
4009 final __test = new SimpleParserTest(); | |
4010 runJUnitTest(__test, __test.test_parseClassDeclaration_abstract); | |
4011 }); | |
4012 _ut.test('test_parseClassDeclaration_empty', () { | |
4013 final __test = new SimpleParserTest(); | |
4014 runJUnitTest(__test, __test.test_parseClassDeclaration_empty); | |
4015 }); | |
4016 _ut.test('test_parseClassDeclaration_extends', () { | |
4017 final __test = new SimpleParserTest(); | |
4018 runJUnitTest(__test, __test.test_parseClassDeclaration_extends); | |
4019 }); | |
4020 _ut.test('test_parseClassDeclaration_extendsAndImplements', () { | |
4021 final __test = new SimpleParserTest(); | |
4022 runJUnitTest(__test, __test.test_parseClassDeclaration_extendsAndImpleme
nts); | |
4023 }); | |
4024 _ut.test('test_parseClassDeclaration_extendsAndWith', () { | |
4025 final __test = new SimpleParserTest(); | |
4026 runJUnitTest(__test, __test.test_parseClassDeclaration_extendsAndWith); | |
4027 }); | |
4028 _ut.test('test_parseClassDeclaration_extendsAndWithAndImplements', () { | |
4029 final __test = new SimpleParserTest(); | |
4030 runJUnitTest(__test, __test.test_parseClassDeclaration_extendsAndWithAnd
Implements); | |
4031 }); | |
4032 _ut.test('test_parseClassDeclaration_implements', () { | |
4033 final __test = new SimpleParserTest(); | |
4034 runJUnitTest(__test, __test.test_parseClassDeclaration_implements); | |
4035 }); | |
4036 _ut.test('test_parseClassDeclaration_nonEmpty', () { | |
4037 final __test = new SimpleParserTest(); | |
4038 runJUnitTest(__test, __test.test_parseClassDeclaration_nonEmpty); | |
4039 }); | |
4040 _ut.test('test_parseClassDeclaration_typeParameters', () { | |
4041 final __test = new SimpleParserTest(); | |
4042 runJUnitTest(__test, __test.test_parseClassDeclaration_typeParameters); | |
4043 }); | |
4044 _ut.test('test_parseClassMember_constructor_withInitializers', () { | |
4045 final __test = new SimpleParserTest(); | |
4046 runJUnitTest(__test, __test.test_parseClassMember_constructor_withInitia
lizers); | |
4047 }); | |
4048 _ut.test('test_parseClassMember_field_instance_prefixedType', () { | |
4049 final __test = new SimpleParserTest(); | |
4050 runJUnitTest(__test, __test.test_parseClassMember_field_instance_prefixe
dType); | |
4051 }); | |
4052 _ut.test('test_parseClassMember_field_namedGet', () { | |
4053 final __test = new SimpleParserTest(); | |
4054 runJUnitTest(__test, __test.test_parseClassMember_field_namedGet); | |
4055 }); | |
4056 _ut.test('test_parseClassMember_field_namedOperator', () { | |
4057 final __test = new SimpleParserTest(); | |
4058 runJUnitTest(__test, __test.test_parseClassMember_field_namedOperator); | |
4059 }); | |
4060 _ut.test('test_parseClassMember_field_namedSet', () { | |
4061 final __test = new SimpleParserTest(); | |
4062 runJUnitTest(__test, __test.test_parseClassMember_field_namedSet); | |
4063 }); | |
4064 _ut.test('test_parseClassMember_getter_void', () { | |
4065 final __test = new SimpleParserTest(); | |
4066 runJUnitTest(__test, __test.test_parseClassMember_getter_void); | |
4067 }); | |
4068 _ut.test('test_parseClassMember_method_external', () { | |
4069 final __test = new SimpleParserTest(); | |
4070 runJUnitTest(__test, __test.test_parseClassMember_method_external); | |
4071 }); | |
4072 _ut.test('test_parseClassMember_method_external_withTypeAndArgs', () { | |
4073 final __test = new SimpleParserTest(); | |
4074 runJUnitTest(__test, __test.test_parseClassMember_method_external_withTy
peAndArgs); | |
4075 }); | |
4076 _ut.test('test_parseClassMember_method_get_noType', () { | |
4077 final __test = new SimpleParserTest(); | |
4078 runJUnitTest(__test, __test.test_parseClassMember_method_get_noType); | |
4079 }); | |
4080 _ut.test('test_parseClassMember_method_get_type', () { | |
4081 final __test = new SimpleParserTest(); | |
4082 runJUnitTest(__test, __test.test_parseClassMember_method_get_type); | |
4083 }); | |
4084 _ut.test('test_parseClassMember_method_get_void', () { | |
4085 final __test = new SimpleParserTest(); | |
4086 runJUnitTest(__test, __test.test_parseClassMember_method_get_void); | |
4087 }); | |
4088 _ut.test('test_parseClassMember_method_operator_noType', () { | |
4089 final __test = new SimpleParserTest(); | |
4090 runJUnitTest(__test, __test.test_parseClassMember_method_operator_noType
); | |
4091 }); | |
4092 _ut.test('test_parseClassMember_method_operator_type', () { | |
4093 final __test = new SimpleParserTest(); | |
4094 runJUnitTest(__test, __test.test_parseClassMember_method_operator_type); | |
4095 }); | |
4096 _ut.test('test_parseClassMember_method_operator_void', () { | |
4097 final __test = new SimpleParserTest(); | |
4098 runJUnitTest(__test, __test.test_parseClassMember_method_operator_void); | |
4099 }); | |
4100 _ut.test('test_parseClassMember_method_returnType_parameterized', () { | |
4101 final __test = new SimpleParserTest(); | |
4102 runJUnitTest(__test, __test.test_parseClassMember_method_returnType_para
meterized); | |
4103 }); | |
4104 _ut.test('test_parseClassMember_method_set_noType', () { | |
4105 final __test = new SimpleParserTest(); | |
4106 runJUnitTest(__test, __test.test_parseClassMember_method_set_noType); | |
4107 }); | |
4108 _ut.test('test_parseClassMember_method_set_type', () { | |
4109 final __test = new SimpleParserTest(); | |
4110 runJUnitTest(__test, __test.test_parseClassMember_method_set_type); | |
4111 }); | |
4112 _ut.test('test_parseClassMember_method_set_void', () { | |
4113 final __test = new SimpleParserTest(); | |
4114 runJUnitTest(__test, __test.test_parseClassMember_method_set_void); | |
4115 }); | |
4116 _ut.test('test_parseClassMember_operator_index', () { | |
4117 final __test = new SimpleParserTest(); | |
4118 runJUnitTest(__test, __test.test_parseClassMember_operator_index); | |
4119 }); | |
4120 _ut.test('test_parseClassMember_operator_indexAssign', () { | |
4121 final __test = new SimpleParserTest(); | |
4122 runJUnitTest(__test, __test.test_parseClassMember_operator_indexAssign); | |
4123 }); | |
4124 _ut.test('test_parseClassMember_redirectingFactory_const', () { | |
4125 final __test = new SimpleParserTest(); | |
4126 runJUnitTest(__test, __test.test_parseClassMember_redirectingFactory_con
st); | |
4127 }); | |
4128 _ut.test('test_parseClassMember_redirectingFactory_nonConst', () { | |
4129 final __test = new SimpleParserTest(); | |
4130 runJUnitTest(__test, __test.test_parseClassMember_redirectingFactory_non
Const); | |
4131 }); | |
4132 _ut.test('test_parseCombinators_h', () { | |
4133 final __test = new SimpleParserTest(); | |
4134 runJUnitTest(__test, __test.test_parseCombinators_h); | |
4135 }); | |
4136 _ut.test('test_parseCombinators_hs', () { | |
4137 final __test = new SimpleParserTest(); | |
4138 runJUnitTest(__test, __test.test_parseCombinators_hs); | |
4139 }); | |
4140 _ut.test('test_parseCombinators_hshs', () { | |
4141 final __test = new SimpleParserTest(); | |
4142 runJUnitTest(__test, __test.test_parseCombinators_hshs); | |
4143 }); | |
4144 _ut.test('test_parseCombinators_s', () { | |
4145 final __test = new SimpleParserTest(); | |
4146 runJUnitTest(__test, __test.test_parseCombinators_s); | |
4147 }); | |
4148 _ut.test('test_parseCommentAndMetadata_c', () { | |
4149 final __test = new SimpleParserTest(); | |
4150 runJUnitTest(__test, __test.test_parseCommentAndMetadata_c); | |
4151 }); | |
4152 _ut.test('test_parseCommentAndMetadata_cmc', () { | |
4153 final __test = new SimpleParserTest(); | |
4154 runJUnitTest(__test, __test.test_parseCommentAndMetadata_cmc); | |
4155 }); | |
4156 _ut.test('test_parseCommentAndMetadata_cmcm', () { | |
4157 final __test = new SimpleParserTest(); | |
4158 runJUnitTest(__test, __test.test_parseCommentAndMetadata_cmcm); | |
4159 }); | |
4160 _ut.test('test_parseCommentAndMetadata_cmm', () { | |
4161 final __test = new SimpleParserTest(); | |
4162 runJUnitTest(__test, __test.test_parseCommentAndMetadata_cmm); | |
4163 }); | |
4164 _ut.test('test_parseCommentAndMetadata_m', () { | |
4165 final __test = new SimpleParserTest(); | |
4166 runJUnitTest(__test, __test.test_parseCommentAndMetadata_m); | |
4167 }); | |
4168 _ut.test('test_parseCommentAndMetadata_mcm', () { | |
4169 final __test = new SimpleParserTest(); | |
4170 runJUnitTest(__test, __test.test_parseCommentAndMetadata_mcm); | |
4171 }); | |
4172 _ut.test('test_parseCommentAndMetadata_mcmc', () { | |
4173 final __test = new SimpleParserTest(); | |
4174 runJUnitTest(__test, __test.test_parseCommentAndMetadata_mcmc); | |
4175 }); | |
4176 _ut.test('test_parseCommentAndMetadata_mm', () { | |
4177 final __test = new SimpleParserTest(); | |
4178 runJUnitTest(__test, __test.test_parseCommentAndMetadata_mm); | |
4179 }); | |
4180 _ut.test('test_parseCommentAndMetadata_none', () { | |
4181 final __test = new SimpleParserTest(); | |
4182 runJUnitTest(__test, __test.test_parseCommentAndMetadata_none); | |
4183 }); | |
4184 _ut.test('test_parseCommentReference_new_prefixed', () { | |
4185 final __test = new SimpleParserTest(); | |
4186 runJUnitTest(__test, __test.test_parseCommentReference_new_prefixed); | |
4187 }); | |
4188 _ut.test('test_parseCommentReference_new_simple', () { | |
4189 final __test = new SimpleParserTest(); | |
4190 runJUnitTest(__test, __test.test_parseCommentReference_new_simple); | |
4191 }); | |
4192 _ut.test('test_parseCommentReference_prefixed', () { | |
4193 final __test = new SimpleParserTest(); | |
4194 runJUnitTest(__test, __test.test_parseCommentReference_prefixed); | |
4195 }); | |
4196 _ut.test('test_parseCommentReference_simple', () { | |
4197 final __test = new SimpleParserTest(); | |
4198 runJUnitTest(__test, __test.test_parseCommentReference_simple); | |
4199 }); | |
4200 _ut.test('test_parseCommentReferences_multiLine', () { | |
4201 final __test = new SimpleParserTest(); | |
4202 runJUnitTest(__test, __test.test_parseCommentReferences_multiLine); | |
4203 }); | |
4204 _ut.test('test_parseCommentReferences_singleLine', () { | |
4205 final __test = new SimpleParserTest(); | |
4206 runJUnitTest(__test, __test.test_parseCommentReferences_singleLine); | |
4207 }); | |
4208 _ut.test('test_parseCompilationUnitMember_abstractAsPrefix', () { | |
4209 final __test = new SimpleParserTest(); | |
4210 runJUnitTest(__test, __test.test_parseCompilationUnitMember_abstractAsPr
efix); | |
4211 }); | |
4212 _ut.test('test_parseCompilationUnitMember_class', () { | |
4213 final __test = new SimpleParserTest(); | |
4214 runJUnitTest(__test, __test.test_parseCompilationUnitMember_class); | |
4215 }); | |
4216 _ut.test('test_parseCompilationUnitMember_constVariable', () { | |
4217 final __test = new SimpleParserTest(); | |
4218 runJUnitTest(__test, __test.test_parseCompilationUnitMember_constVariabl
e); | |
4219 }); | |
4220 _ut.test('test_parseCompilationUnitMember_finalVariable', () { | |
4221 final __test = new SimpleParserTest(); | |
4222 runJUnitTest(__test, __test.test_parseCompilationUnitMember_finalVariabl
e); | |
4223 }); | |
4224 _ut.test('test_parseCompilationUnitMember_function_external_noType', () { | |
4225 final __test = new SimpleParserTest(); | |
4226 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_ext
ernal_noType); | |
4227 }); | |
4228 _ut.test('test_parseCompilationUnitMember_function_external_type', () { | |
4229 final __test = new SimpleParserTest(); | |
4230 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_ext
ernal_type); | |
4231 }); | |
4232 _ut.test('test_parseCompilationUnitMember_function_noType', () { | |
4233 final __test = new SimpleParserTest(); | |
4234 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_noT
ype); | |
4235 }); | |
4236 _ut.test('test_parseCompilationUnitMember_function_type', () { | |
4237 final __test = new SimpleParserTest(); | |
4238 runJUnitTest(__test, __test.test_parseCompilationUnitMember_function_typ
e); | |
4239 }); | |
4240 _ut.test('test_parseCompilationUnitMember_getter_external_noType', () { | |
4241 final __test = new SimpleParserTest(); | |
4242 runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_exter
nal_noType); | |
4243 }); | |
4244 _ut.test('test_parseCompilationUnitMember_getter_external_type', () { | |
4245 final __test = new SimpleParserTest(); | |
4246 runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_exter
nal_type); | |
4247 }); | |
4248 _ut.test('test_parseCompilationUnitMember_getter_noType', () { | |
4249 final __test = new SimpleParserTest(); | |
4250 runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_noTyp
e); | |
4251 }); | |
4252 _ut.test('test_parseCompilationUnitMember_getter_type', () { | |
4253 final __test = new SimpleParserTest(); | |
4254 runJUnitTest(__test, __test.test_parseCompilationUnitMember_getter_type)
; | |
4255 }); | |
4256 _ut.test('test_parseCompilationUnitMember_setter_external_noType', () { | |
4257 final __test = new SimpleParserTest(); | |
4258 runJUnitTest(__test, __test.test_parseCompilationUnitMember_setter_exter
nal_noType); | |
4259 }); | |
4260 _ut.test('test_parseCompilationUnitMember_setter_external_type', () { | |
4261 final __test = new SimpleParserTest(); | |
4262 runJUnitTest(__test, __test.test_parseCompilationUnitMember_setter_exter
nal_type); | |
4263 }); | |
4264 _ut.test('test_parseCompilationUnitMember_setter_noType', () { | |
4265 final __test = new SimpleParserTest(); | |
4266 runJUnitTest(__test, __test.test_parseCompilationUnitMember_setter_noTyp
e); | |
4267 }); | |
4268 _ut.test('test_parseCompilationUnitMember_setter_type', () { | |
4269 final __test = new SimpleParserTest(); | |
4270 runJUnitTest(__test, __test.test_parseCompilationUnitMember_setter_type)
; | |
4271 }); | |
4272 _ut.test('test_parseCompilationUnitMember_typedef_class_abstract', () { | |
4273 final __test = new SimpleParserTest(); | |
4274 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_clas
s_abstract); | |
4275 }); | |
4276 _ut.test('test_parseCompilationUnitMember_typedef_class_generic', () { | |
4277 final __test = new SimpleParserTest(); | |
4278 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_clas
s_generic); | |
4279 }); | |
4280 _ut.test('test_parseCompilationUnitMember_typedef_class_implements', () { | |
4281 final __test = new SimpleParserTest(); | |
4282 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_clas
s_implements); | |
4283 }); | |
4284 _ut.test('test_parseCompilationUnitMember_typedef_class_noImplements', ()
{ | |
4285 final __test = new SimpleParserTest(); | |
4286 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_clas
s_noImplements); | |
4287 }); | |
4288 _ut.test('test_parseCompilationUnitMember_typedef_function', () { | |
4289 final __test = new SimpleParserTest(); | |
4290 runJUnitTest(__test, __test.test_parseCompilationUnitMember_typedef_func
tion); | |
4291 }); | |
4292 _ut.test('test_parseCompilationUnitMember_variable', () { | |
4293 final __test = new SimpleParserTest(); | |
4294 runJUnitTest(__test, __test.test_parseCompilationUnitMember_variable); | |
4295 }); | |
4296 _ut.test('test_parseCompilationUnit_abstractAsPrefix_parameterized', () { | |
4297 final __test = new SimpleParserTest(); | |
4298 runJUnitTest(__test, __test.test_parseCompilationUnit_abstractAsPrefix_p
arameterized); | |
4299 }); | |
4300 _ut.test('test_parseCompilationUnit_directives_multiple', () { | |
4301 final __test = new SimpleParserTest(); | |
4302 runJUnitTest(__test, __test.test_parseCompilationUnit_directives_multipl
e); | |
4303 }); | |
4304 _ut.test('test_parseCompilationUnit_directives_single', () { | |
4305 final __test = new SimpleParserTest(); | |
4306 runJUnitTest(__test, __test.test_parseCompilationUnit_directives_single)
; | |
4307 }); | |
4308 _ut.test('test_parseCompilationUnit_empty', () { | |
4309 final __test = new SimpleParserTest(); | |
4310 runJUnitTest(__test, __test.test_parseCompilationUnit_empty); | |
4311 }); | |
4312 _ut.test('test_parseCompilationUnit_exportAsPrefix', () { | |
4313 final __test = new SimpleParserTest(); | |
4314 runJUnitTest(__test, __test.test_parseCompilationUnit_exportAsPrefix); | |
4315 }); | |
4316 _ut.test('test_parseCompilationUnit_exportAsPrefix_parameterized', () { | |
4317 final __test = new SimpleParserTest(); | |
4318 runJUnitTest(__test, __test.test_parseCompilationUnit_exportAsPrefix_par
ameterized); | |
4319 }); | |
4320 _ut.test('test_parseCompilationUnit_operatorAsPrefix_parameterized', () { | |
4321 final __test = new SimpleParserTest(); | |
4322 runJUnitTest(__test, __test.test_parseCompilationUnit_operatorAsPrefix_p
arameterized); | |
4323 }); | |
4324 _ut.test('test_parseCompilationUnit_script', () { | |
4325 final __test = new SimpleParserTest(); | |
4326 runJUnitTest(__test, __test.test_parseCompilationUnit_script); | |
4327 }); | |
4328 _ut.test('test_parseCompilationUnit_topLevelDeclaration', () { | |
4329 final __test = new SimpleParserTest(); | |
4330 runJUnitTest(__test, __test.test_parseCompilationUnit_topLevelDeclaratio
n); | |
4331 }); | |
4332 _ut.test('test_parseCompilationUnit_typedefAsPrefix', () { | |
4333 final __test = new SimpleParserTest(); | |
4334 runJUnitTest(__test, __test.test_parseCompilationUnit_typedefAsPrefix); | |
4335 }); | |
4336 _ut.test('test_parseConditionalExpression', () { | |
4337 final __test = new SimpleParserTest(); | |
4338 runJUnitTest(__test, __test.test_parseConditionalExpression); | |
4339 }); | |
4340 _ut.test('test_parseConstExpression_instanceCreation', () { | |
4341 final __test = new SimpleParserTest(); | |
4342 runJUnitTest(__test, __test.test_parseConstExpression_instanceCreation); | |
4343 }); | |
4344 _ut.test('test_parseConstExpression_listLiteral_typed', () { | |
4345 final __test = new SimpleParserTest(); | |
4346 runJUnitTest(__test, __test.test_parseConstExpression_listLiteral_typed)
; | |
4347 }); | |
4348 _ut.test('test_parseConstExpression_listLiteral_untyped', () { | |
4349 final __test = new SimpleParserTest(); | |
4350 runJUnitTest(__test, __test.test_parseConstExpression_listLiteral_untype
d); | |
4351 }); | |
4352 _ut.test('test_parseConstExpression_mapLiteral_typed', () { | |
4353 final __test = new SimpleParserTest(); | |
4354 runJUnitTest(__test, __test.test_parseConstExpression_mapLiteral_typed); | |
4355 }); | |
4356 _ut.test('test_parseConstExpression_mapLiteral_untyped', () { | |
4357 final __test = new SimpleParserTest(); | |
4358 runJUnitTest(__test, __test.test_parseConstExpression_mapLiteral_untyped
); | |
4359 }); | |
4360 _ut.test('test_parseConstructor', () { | |
4361 final __test = new SimpleParserTest(); | |
4362 runJUnitTest(__test, __test.test_parseConstructor); | |
4363 }); | |
4364 _ut.test('test_parseConstructorFieldInitializer_qualified', () { | |
4365 final __test = new SimpleParserTest(); | |
4366 runJUnitTest(__test, __test.test_parseConstructorFieldInitializer_qualif
ied); | |
4367 }); | |
4368 _ut.test('test_parseConstructorFieldInitializer_unqualified', () { | |
4369 final __test = new SimpleParserTest(); | |
4370 runJUnitTest(__test, __test.test_parseConstructorFieldInitializer_unqual
ified); | |
4371 }); | |
4372 _ut.test('test_parseConstructorName_named_noPrefix', () { | |
4373 final __test = new SimpleParserTest(); | |
4374 runJUnitTest(__test, __test.test_parseConstructorName_named_noPrefix); | |
4375 }); | |
4376 _ut.test('test_parseConstructorName_named_prefixed', () { | |
4377 final __test = new SimpleParserTest(); | |
4378 runJUnitTest(__test, __test.test_parseConstructorName_named_prefixed); | |
4379 }); | |
4380 _ut.test('test_parseConstructorName_unnamed_noPrefix', () { | |
4381 final __test = new SimpleParserTest(); | |
4382 runJUnitTest(__test, __test.test_parseConstructorName_unnamed_noPrefix); | |
4383 }); | |
4384 _ut.test('test_parseConstructorName_unnamed_prefixed', () { | |
4385 final __test = new SimpleParserTest(); | |
4386 runJUnitTest(__test, __test.test_parseConstructorName_unnamed_prefixed); | |
4387 }); | |
4388 _ut.test('test_parseContinueStatement_label', () { | |
4389 final __test = new SimpleParserTest(); | |
4390 runJUnitTest(__test, __test.test_parseContinueStatement_label); | |
4391 }); | |
4392 _ut.test('test_parseContinueStatement_noLabel', () { | |
4393 final __test = new SimpleParserTest(); | |
4394 runJUnitTest(__test, __test.test_parseContinueStatement_noLabel); | |
4395 }); | |
4396 _ut.test('test_parseDirective_export', () { | |
4397 final __test = new SimpleParserTest(); | |
4398 runJUnitTest(__test, __test.test_parseDirective_export); | |
4399 }); | |
4400 _ut.test('test_parseDirective_import', () { | |
4401 final __test = new SimpleParserTest(); | |
4402 runJUnitTest(__test, __test.test_parseDirective_import); | |
4403 }); | |
4404 _ut.test('test_parseDirective_library', () { | |
4405 final __test = new SimpleParserTest(); | |
4406 runJUnitTest(__test, __test.test_parseDirective_library); | |
4407 }); | |
4408 _ut.test('test_parseDirective_part', () { | |
4409 final __test = new SimpleParserTest(); | |
4410 runJUnitTest(__test, __test.test_parseDirective_part); | |
4411 }); | |
4412 _ut.test('test_parseDirective_partOf', () { | |
4413 final __test = new SimpleParserTest(); | |
4414 runJUnitTest(__test, __test.test_parseDirective_partOf); | |
4415 }); | |
4416 _ut.test('test_parseDoStatement', () { | |
4417 final __test = new SimpleParserTest(); | |
4418 runJUnitTest(__test, __test.test_parseDoStatement); | |
4419 }); | |
4420 _ut.test('test_parseDocumentationComment_block', () { | |
4421 final __test = new SimpleParserTest(); | |
4422 runJUnitTest(__test, __test.test_parseDocumentationComment_block); | |
4423 }); | |
4424 _ut.test('test_parseDocumentationComment_block_withReference', () { | |
4425 final __test = new SimpleParserTest(); | |
4426 runJUnitTest(__test, __test.test_parseDocumentationComment_block_withRef
erence); | |
4427 }); | |
4428 _ut.test('test_parseDocumentationComment_endOfLine', () { | |
4429 final __test = new SimpleParserTest(); | |
4430 runJUnitTest(__test, __test.test_parseDocumentationComment_endOfLine); | |
4431 }); | |
4432 _ut.test('test_parseEmptyStatement', () { | |
4433 final __test = new SimpleParserTest(); | |
4434 runJUnitTest(__test, __test.test_parseEmptyStatement); | |
4435 }); | |
4436 _ut.test('test_parseEqualityExpression_normal', () { | |
4437 final __test = new SimpleParserTest(); | |
4438 runJUnitTest(__test, __test.test_parseEqualityExpression_normal); | |
4439 }); | |
4440 _ut.test('test_parseEqualityExpression_super', () { | |
4441 final __test = new SimpleParserTest(); | |
4442 runJUnitTest(__test, __test.test_parseEqualityExpression_super); | |
4443 }); | |
4444 _ut.test('test_parseExportDirective_hide', () { | |
4445 final __test = new SimpleParserTest(); | |
4446 runJUnitTest(__test, __test.test_parseExportDirective_hide); | |
4447 }); | |
4448 _ut.test('test_parseExportDirective_hide_show', () { | |
4449 final __test = new SimpleParserTest(); | |
4450 runJUnitTest(__test, __test.test_parseExportDirective_hide_show); | |
4451 }); | |
4452 _ut.test('test_parseExportDirective_noCombinator', () { | |
4453 final __test = new SimpleParserTest(); | |
4454 runJUnitTest(__test, __test.test_parseExportDirective_noCombinator); | |
4455 }); | |
4456 _ut.test('test_parseExportDirective_show', () { | |
4457 final __test = new SimpleParserTest(); | |
4458 runJUnitTest(__test, __test.test_parseExportDirective_show); | |
4459 }); | |
4460 _ut.test('test_parseExportDirective_show_hide', () { | |
4461 final __test = new SimpleParserTest(); | |
4462 runJUnitTest(__test, __test.test_parseExportDirective_show_hide); | |
4463 }); | |
4464 _ut.test('test_parseExpressionList_multiple', () { | |
4465 final __test = new SimpleParserTest(); | |
4466 runJUnitTest(__test, __test.test_parseExpressionList_multiple); | |
4467 }); | |
4468 _ut.test('test_parseExpressionList_single', () { | |
4469 final __test = new SimpleParserTest(); | |
4470 runJUnitTest(__test, __test.test_parseExpressionList_single); | |
4471 }); | |
4472 _ut.test('test_parseExpressionWithoutCascade_assign', () { | |
4473 final __test = new SimpleParserTest(); | |
4474 runJUnitTest(__test, __test.test_parseExpressionWithoutCascade_assign); | |
4475 }); | |
4476 _ut.test('test_parseExpressionWithoutCascade_comparison', () { | |
4477 final __test = new SimpleParserTest(); | |
4478 runJUnitTest(__test, __test.test_parseExpressionWithoutCascade_compariso
n); | |
4479 }); | |
4480 _ut.test('test_parseExpressionWithoutCascade_superMethodInvocation', () { | |
4481 final __test = new SimpleParserTest(); | |
4482 runJUnitTest(__test, __test.test_parseExpressionWithoutCascade_superMeth
odInvocation); | |
4483 }); | |
4484 _ut.test('test_parseExpression_assign', () { | |
4485 final __test = new SimpleParserTest(); | |
4486 runJUnitTest(__test, __test.test_parseExpression_assign); | |
4487 }); | |
4488 _ut.test('test_parseExpression_comparison', () { | |
4489 final __test = new SimpleParserTest(); | |
4490 runJUnitTest(__test, __test.test_parseExpression_comparison); | |
4491 }); | |
4492 _ut.test('test_parseExpression_invokeFunctionExpression', () { | |
4493 final __test = new SimpleParserTest(); | |
4494 runJUnitTest(__test, __test.test_parseExpression_invokeFunctionExpressio
n); | |
4495 }); | |
4496 _ut.test('test_parseExpression_superMethodInvocation', () { | |
4497 final __test = new SimpleParserTest(); | |
4498 runJUnitTest(__test, __test.test_parseExpression_superMethodInvocation); | |
4499 }); | |
4500 _ut.test('test_parseExtendsClause', () { | |
4501 final __test = new SimpleParserTest(); | |
4502 runJUnitTest(__test, __test.test_parseExtendsClause); | |
4503 }); | |
4504 _ut.test('test_parseFinalConstVarOrType_const_noType', () { | |
4505 final __test = new SimpleParserTest(); | |
4506 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_const_noType); | |
4507 }); | |
4508 _ut.test('test_parseFinalConstVarOrType_const_type', () { | |
4509 final __test = new SimpleParserTest(); | |
4510 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_const_type); | |
4511 }); | |
4512 _ut.test('test_parseFinalConstVarOrType_final_noType', () { | |
4513 final __test = new SimpleParserTest(); | |
4514 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_final_noType); | |
4515 }); | |
4516 _ut.test('test_parseFinalConstVarOrType_final_type', () { | |
4517 final __test = new SimpleParserTest(); | |
4518 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_final_type); | |
4519 }); | |
4520 _ut.test('test_parseFinalConstVarOrType_type_parameterized', () { | |
4521 final __test = new SimpleParserTest(); | |
4522 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_type_parameter
ized); | |
4523 }); | |
4524 _ut.test('test_parseFinalConstVarOrType_type_prefixed', () { | |
4525 final __test = new SimpleParserTest(); | |
4526 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_type_prefixed)
; | |
4527 }); | |
4528 _ut.test('test_parseFinalConstVarOrType_type_prefixedAndParameterized', ()
{ | |
4529 final __test = new SimpleParserTest(); | |
4530 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_type_prefixedA
ndParameterized); | |
4531 }); | |
4532 _ut.test('test_parseFinalConstVarOrType_type_simple', () { | |
4533 final __test = new SimpleParserTest(); | |
4534 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_type_simple); | |
4535 }); | |
4536 _ut.test('test_parseFinalConstVarOrType_var', () { | |
4537 final __test = new SimpleParserTest(); | |
4538 runJUnitTest(__test, __test.test_parseFinalConstVarOrType_var); | |
4539 }); | |
4540 _ut.test('test_parseForStatement_each_identifier', () { | |
4541 final __test = new SimpleParserTest(); | |
4542 runJUnitTest(__test, __test.test_parseForStatement_each_identifier); | |
4543 }); | |
4544 _ut.test('test_parseForStatement_each_noType', () { | |
4545 final __test = new SimpleParserTest(); | |
4546 runJUnitTest(__test, __test.test_parseForStatement_each_noType); | |
4547 }); | |
4548 _ut.test('test_parseForStatement_each_type', () { | |
4549 final __test = new SimpleParserTest(); | |
4550 runJUnitTest(__test, __test.test_parseForStatement_each_type); | |
4551 }); | |
4552 _ut.test('test_parseForStatement_each_var', () { | |
4553 final __test = new SimpleParserTest(); | |
4554 runJUnitTest(__test, __test.test_parseForStatement_each_var); | |
4555 }); | |
4556 _ut.test('test_parseForStatement_loop_c', () { | |
4557 final __test = new SimpleParserTest(); | |
4558 runJUnitTest(__test, __test.test_parseForStatement_loop_c); | |
4559 }); | |
4560 _ut.test('test_parseForStatement_loop_cu', () { | |
4561 final __test = new SimpleParserTest(); | |
4562 runJUnitTest(__test, __test.test_parseForStatement_loop_cu); | |
4563 }); | |
4564 _ut.test('test_parseForStatement_loop_ecu', () { | |
4565 final __test = new SimpleParserTest(); | |
4566 runJUnitTest(__test, __test.test_parseForStatement_loop_ecu); | |
4567 }); | |
4568 _ut.test('test_parseForStatement_loop_i', () { | |
4569 final __test = new SimpleParserTest(); | |
4570 runJUnitTest(__test, __test.test_parseForStatement_loop_i); | |
4571 }); | |
4572 _ut.test('test_parseForStatement_loop_ic', () { | |
4573 final __test = new SimpleParserTest(); | |
4574 runJUnitTest(__test, __test.test_parseForStatement_loop_ic); | |
4575 }); | |
4576 _ut.test('test_parseForStatement_loop_icu', () { | |
4577 final __test = new SimpleParserTest(); | |
4578 runJUnitTest(__test, __test.test_parseForStatement_loop_icu); | |
4579 }); | |
4580 _ut.test('test_parseForStatement_loop_iicuu', () { | |
4581 final __test = new SimpleParserTest(); | |
4582 runJUnitTest(__test, __test.test_parseForStatement_loop_iicuu); | |
4583 }); | |
4584 _ut.test('test_parseForStatement_loop_iu', () { | |
4585 final __test = new SimpleParserTest(); | |
4586 runJUnitTest(__test, __test.test_parseForStatement_loop_iu); | |
4587 }); | |
4588 _ut.test('test_parseForStatement_loop_u', () { | |
4589 final __test = new SimpleParserTest(); | |
4590 runJUnitTest(__test, __test.test_parseForStatement_loop_u); | |
4591 }); | |
4592 _ut.test('test_parseFormalParameterList_empty', () { | |
4593 final __test = new SimpleParserTest(); | |
4594 runJUnitTest(__test, __test.test_parseFormalParameterList_empty); | |
4595 }); | |
4596 _ut.test('test_parseFormalParameterList_named_multiple', () { | |
4597 final __test = new SimpleParserTest(); | |
4598 runJUnitTest(__test, __test.test_parseFormalParameterList_named_multiple
); | |
4599 }); | |
4600 _ut.test('test_parseFormalParameterList_named_single', () { | |
4601 final __test = new SimpleParserTest(); | |
4602 runJUnitTest(__test, __test.test_parseFormalParameterList_named_single); | |
4603 }); | |
4604 _ut.test('test_parseFormalParameterList_normal_multiple', () { | |
4605 final __test = new SimpleParserTest(); | |
4606 runJUnitTest(__test, __test.test_parseFormalParameterList_normal_multipl
e); | |
4607 }); | |
4608 _ut.test('test_parseFormalParameterList_normal_named', () { | |
4609 final __test = new SimpleParserTest(); | |
4610 runJUnitTest(__test, __test.test_parseFormalParameterList_normal_named); | |
4611 }); | |
4612 _ut.test('test_parseFormalParameterList_normal_positional', () { | |
4613 final __test = new SimpleParserTest(); | |
4614 runJUnitTest(__test, __test.test_parseFormalParameterList_normal_positio
nal); | |
4615 }); | |
4616 _ut.test('test_parseFormalParameterList_normal_single', () { | |
4617 final __test = new SimpleParserTest(); | |
4618 runJUnitTest(__test, __test.test_parseFormalParameterList_normal_single)
; | |
4619 }); | |
4620 _ut.test('test_parseFormalParameterList_positional_multiple', () { | |
4621 final __test = new SimpleParserTest(); | |
4622 runJUnitTest(__test, __test.test_parseFormalParameterList_positional_mul
tiple); | |
4623 }); | |
4624 _ut.test('test_parseFormalParameterList_positional_single', () { | |
4625 final __test = new SimpleParserTest(); | |
4626 runJUnitTest(__test, __test.test_parseFormalParameterList_positional_sin
gle); | |
4627 }); | |
4628 _ut.test('test_parseFormalParameter_final_withType_named', () { | |
4629 final __test = new SimpleParserTest(); | |
4630 runJUnitTest(__test, __test.test_parseFormalParameter_final_withType_nam
ed); | |
4631 }); | |
4632 _ut.test('test_parseFormalParameter_final_withType_normal', () { | |
4633 final __test = new SimpleParserTest(); | |
4634 runJUnitTest(__test, __test.test_parseFormalParameter_final_withType_nor
mal); | |
4635 }); | |
4636 _ut.test('test_parseFormalParameter_final_withType_positional', () { | |
4637 final __test = new SimpleParserTest(); | |
4638 runJUnitTest(__test, __test.test_parseFormalParameter_final_withType_pos
itional); | |
4639 }); | |
4640 _ut.test('test_parseFormalParameter_nonFinal_withType_named', () { | |
4641 final __test = new SimpleParserTest(); | |
4642 runJUnitTest(__test, __test.test_parseFormalParameter_nonFinal_withType_
named); | |
4643 }); | |
4644 _ut.test('test_parseFormalParameter_nonFinal_withType_normal', () { | |
4645 final __test = new SimpleParserTest(); | |
4646 runJUnitTest(__test, __test.test_parseFormalParameter_nonFinal_withType_
normal); | |
4647 }); | |
4648 _ut.test('test_parseFormalParameter_nonFinal_withType_positional', () { | |
4649 final __test = new SimpleParserTest(); | |
4650 runJUnitTest(__test, __test.test_parseFormalParameter_nonFinal_withType_
positional); | |
4651 }); | |
4652 _ut.test('test_parseFormalParameter_var', () { | |
4653 final __test = new SimpleParserTest(); | |
4654 runJUnitTest(__test, __test.test_parseFormalParameter_var); | |
4655 }); | |
4656 _ut.test('test_parseFormalParameter_var_named', () { | |
4657 final __test = new SimpleParserTest(); | |
4658 runJUnitTest(__test, __test.test_parseFormalParameter_var_named); | |
4659 }); | |
4660 _ut.test('test_parseFormalParameter_var_positional', () { | |
4661 final __test = new SimpleParserTest(); | |
4662 runJUnitTest(__test, __test.test_parseFormalParameter_var_positional); | |
4663 }); | |
4664 _ut.test('test_parseFunctionBody_block', () { | |
4665 final __test = new SimpleParserTest(); | |
4666 runJUnitTest(__test, __test.test_parseFunctionBody_block); | |
4667 }); | |
4668 _ut.test('test_parseFunctionBody_empty', () { | |
4669 final __test = new SimpleParserTest(); | |
4670 runJUnitTest(__test, __test.test_parseFunctionBody_empty); | |
4671 }); | |
4672 _ut.test('test_parseFunctionBody_expression', () { | |
4673 final __test = new SimpleParserTest(); | |
4674 runJUnitTest(__test, __test.test_parseFunctionBody_expression); | |
4675 }); | |
4676 _ut.test('test_parseFunctionDeclarationStatement', () { | |
4677 final __test = new SimpleParserTest(); | |
4678 runJUnitTest(__test, __test.test_parseFunctionDeclarationStatement); | |
4679 }); | |
4680 _ut.test('test_parseFunctionDeclaration_function', () { | |
4681 final __test = new SimpleParserTest(); | |
4682 runJUnitTest(__test, __test.test_parseFunctionDeclaration_function); | |
4683 }); | |
4684 _ut.test('test_parseFunctionDeclaration_getter', () { | |
4685 final __test = new SimpleParserTest(); | |
4686 runJUnitTest(__test, __test.test_parseFunctionDeclaration_getter); | |
4687 }); | |
4688 _ut.test('test_parseFunctionDeclaration_setter', () { | |
4689 final __test = new SimpleParserTest(); | |
4690 runJUnitTest(__test, __test.test_parseFunctionDeclaration_setter); | |
4691 }); | |
4692 _ut.test('test_parseFunctionExpression_body_inExpression', () { | |
4693 final __test = new SimpleParserTest(); | |
4694 runJUnitTest(__test, __test.test_parseFunctionExpression_body_inExpressi
on); | |
4695 }); | |
4696 _ut.test('test_parseFunctionExpression_minimal', () { | |
4697 final __test = new SimpleParserTest(); | |
4698 runJUnitTest(__test, __test.test_parseFunctionExpression_minimal); | |
4699 }); | |
4700 _ut.test('test_parseGetter_nonStatic', () { | |
4701 final __test = new SimpleParserTest(); | |
4702 runJUnitTest(__test, __test.test_parseGetter_nonStatic); | |
4703 }); | |
4704 _ut.test('test_parseGetter_static', () { | |
4705 final __test = new SimpleParserTest(); | |
4706 runJUnitTest(__test, __test.test_parseGetter_static); | |
4707 }); | |
4708 _ut.test('test_parseIdentifierList_multiple', () { | |
4709 final __test = new SimpleParserTest(); | |
4710 runJUnitTest(__test, __test.test_parseIdentifierList_multiple); | |
4711 }); | |
4712 _ut.test('test_parseIdentifierList_single', () { | |
4713 final __test = new SimpleParserTest(); | |
4714 runJUnitTest(__test, __test.test_parseIdentifierList_single); | |
4715 }); | |
4716 _ut.test('test_parseIfStatement_else_block', () { | |
4717 final __test = new SimpleParserTest(); | |
4718 runJUnitTest(__test, __test.test_parseIfStatement_else_block); | |
4719 }); | |
4720 _ut.test('test_parseIfStatement_else_statement', () { | |
4721 final __test = new SimpleParserTest(); | |
4722 runJUnitTest(__test, __test.test_parseIfStatement_else_statement); | |
4723 }); | |
4724 _ut.test('test_parseIfStatement_noElse_block', () { | |
4725 final __test = new SimpleParserTest(); | |
4726 runJUnitTest(__test, __test.test_parseIfStatement_noElse_block); | |
4727 }); | |
4728 _ut.test('test_parseIfStatement_noElse_statement', () { | |
4729 final __test = new SimpleParserTest(); | |
4730 runJUnitTest(__test, __test.test_parseIfStatement_noElse_statement); | |
4731 }); | |
4732 _ut.test('test_parseImplementsClause_multiple', () { | |
4733 final __test = new SimpleParserTest(); | |
4734 runJUnitTest(__test, __test.test_parseImplementsClause_multiple); | |
4735 }); | |
4736 _ut.test('test_parseImplementsClause_single', () { | |
4737 final __test = new SimpleParserTest(); | |
4738 runJUnitTest(__test, __test.test_parseImplementsClause_single); | |
4739 }); | |
4740 _ut.test('test_parseImportDirective_hide', () { | |
4741 final __test = new SimpleParserTest(); | |
4742 runJUnitTest(__test, __test.test_parseImportDirective_hide); | |
4743 }); | |
4744 _ut.test('test_parseImportDirective_noCombinator', () { | |
4745 final __test = new SimpleParserTest(); | |
4746 runJUnitTest(__test, __test.test_parseImportDirective_noCombinator); | |
4747 }); | |
4748 _ut.test('test_parseImportDirective_prefix', () { | |
4749 final __test = new SimpleParserTest(); | |
4750 runJUnitTest(__test, __test.test_parseImportDirective_prefix); | |
4751 }); | |
4752 _ut.test('test_parseImportDirective_prefix_hide_show', () { | |
4753 final __test = new SimpleParserTest(); | |
4754 runJUnitTest(__test, __test.test_parseImportDirective_prefix_hide_show); | |
4755 }); | |
4756 _ut.test('test_parseImportDirective_prefix_show_hide', () { | |
4757 final __test = new SimpleParserTest(); | |
4758 runJUnitTest(__test, __test.test_parseImportDirective_prefix_show_hide); | |
4759 }); | |
4760 _ut.test('test_parseImportDirective_show', () { | |
4761 final __test = new SimpleParserTest(); | |
4762 runJUnitTest(__test, __test.test_parseImportDirective_show); | |
4763 }); | |
4764 _ut.test('test_parseInitializedIdentifierList_type', () { | |
4765 final __test = new SimpleParserTest(); | |
4766 runJUnitTest(__test, __test.test_parseInitializedIdentifierList_type); | |
4767 }); | |
4768 _ut.test('test_parseInitializedIdentifierList_var', () { | |
4769 final __test = new SimpleParserTest(); | |
4770 runJUnitTest(__test, __test.test_parseInitializedIdentifierList_var); | |
4771 }); | |
4772 _ut.test('test_parseInstanceCreationExpression_qualifiedType', () { | |
4773 final __test = new SimpleParserTest(); | |
4774 runJUnitTest(__test, __test.test_parseInstanceCreationExpression_qualifi
edType); | |
4775 }); | |
4776 _ut.test('test_parseInstanceCreationExpression_qualifiedType_named', () { | |
4777 final __test = new SimpleParserTest(); | |
4778 runJUnitTest(__test, __test.test_parseInstanceCreationExpression_qualifi
edType_named); | |
4779 }); | |
4780 _ut.test('test_parseInstanceCreationExpression_type', () { | |
4781 final __test = new SimpleParserTest(); | |
4782 runJUnitTest(__test, __test.test_parseInstanceCreationExpression_type); | |
4783 }); | |
4784 _ut.test('test_parseInstanceCreationExpression_type_named', () { | |
4785 final __test = new SimpleParserTest(); | |
4786 runJUnitTest(__test, __test.test_parseInstanceCreationExpression_type_na
med); | |
4787 }); | |
4788 _ut.test('test_parseLibraryDirective', () { | |
4789 final __test = new SimpleParserTest(); | |
4790 runJUnitTest(__test, __test.test_parseLibraryDirective); | |
4791 }); | |
4792 _ut.test('test_parseLibraryIdentifier_multiple', () { | |
4793 final __test = new SimpleParserTest(); | |
4794 runJUnitTest(__test, __test.test_parseLibraryIdentifier_multiple); | |
4795 }); | |
4796 _ut.test('test_parseLibraryIdentifier_single', () { | |
4797 final __test = new SimpleParserTest(); | |
4798 runJUnitTest(__test, __test.test_parseLibraryIdentifier_single); | |
4799 }); | |
4800 _ut.test('test_parseListLiteral_empty_oneToken', () { | |
4801 final __test = new SimpleParserTest(); | |
4802 runJUnitTest(__test, __test.test_parseListLiteral_empty_oneToken); | |
4803 }); | |
4804 _ut.test('test_parseListLiteral_empty_twoTokens', () { | |
4805 final __test = new SimpleParserTest(); | |
4806 runJUnitTest(__test, __test.test_parseListLiteral_empty_twoTokens); | |
4807 }); | |
4808 _ut.test('test_parseListLiteral_multiple', () { | |
4809 final __test = new SimpleParserTest(); | |
4810 runJUnitTest(__test, __test.test_parseListLiteral_multiple); | |
4811 }); | |
4812 _ut.test('test_parseListLiteral_single', () { | |
4813 final __test = new SimpleParserTest(); | |
4814 runJUnitTest(__test, __test.test_parseListLiteral_single); | |
4815 }); | |
4816 _ut.test('test_parseListOrMapLiteral_list_noType', () { | |
4817 final __test = new SimpleParserTest(); | |
4818 runJUnitTest(__test, __test.test_parseListOrMapLiteral_list_noType); | |
4819 }); | |
4820 _ut.test('test_parseListOrMapLiteral_list_type', () { | |
4821 final __test = new SimpleParserTest(); | |
4822 runJUnitTest(__test, __test.test_parseListOrMapLiteral_list_type); | |
4823 }); | |
4824 _ut.test('test_parseListOrMapLiteral_map_noType', () { | |
4825 final __test = new SimpleParserTest(); | |
4826 runJUnitTest(__test, __test.test_parseListOrMapLiteral_map_noType); | |
4827 }); | |
4828 _ut.test('test_parseListOrMapLiteral_map_type', () { | |
4829 final __test = new SimpleParserTest(); | |
4830 runJUnitTest(__test, __test.test_parseListOrMapLiteral_map_type); | |
4831 }); | |
4832 _ut.test('test_parseLogicalAndExpression', () { | |
4833 final __test = new SimpleParserTest(); | |
4834 runJUnitTest(__test, __test.test_parseLogicalAndExpression); | |
4835 }); | |
4836 _ut.test('test_parseLogicalOrExpression', () { | |
4837 final __test = new SimpleParserTest(); | |
4838 runJUnitTest(__test, __test.test_parseLogicalOrExpression); | |
4839 }); | |
4840 _ut.test('test_parseMapLiteralEntry', () { | |
4841 final __test = new SimpleParserTest(); | |
4842 runJUnitTest(__test, __test.test_parseMapLiteralEntry); | |
4843 }); | |
4844 _ut.test('test_parseMapLiteral_empty', () { | |
4845 final __test = new SimpleParserTest(); | |
4846 runJUnitTest(__test, __test.test_parseMapLiteral_empty); | |
4847 }); | |
4848 _ut.test('test_parseMapLiteral_multiple', () { | |
4849 final __test = new SimpleParserTest(); | |
4850 runJUnitTest(__test, __test.test_parseMapLiteral_multiple); | |
4851 }); | |
4852 _ut.test('test_parseMapLiteral_single', () { | |
4853 final __test = new SimpleParserTest(); | |
4854 runJUnitTest(__test, __test.test_parseMapLiteral_single); | |
4855 }); | |
4856 _ut.test('test_parseModifiers_abstract', () { | |
4857 final __test = new SimpleParserTest(); | |
4858 runJUnitTest(__test, __test.test_parseModifiers_abstract); | |
4859 }); | |
4860 _ut.test('test_parseModifiers_const', () { | |
4861 final __test = new SimpleParserTest(); | |
4862 runJUnitTest(__test, __test.test_parseModifiers_const); | |
4863 }); | |
4864 _ut.test('test_parseModifiers_external', () { | |
4865 final __test = new SimpleParserTest(); | |
4866 runJUnitTest(__test, __test.test_parseModifiers_external); | |
4867 }); | |
4868 _ut.test('test_parseModifiers_factory', () { | |
4869 final __test = new SimpleParserTest(); | |
4870 runJUnitTest(__test, __test.test_parseModifiers_factory); | |
4871 }); | |
4872 _ut.test('test_parseModifiers_final', () { | |
4873 final __test = new SimpleParserTest(); | |
4874 runJUnitTest(__test, __test.test_parseModifiers_final); | |
4875 }); | |
4876 _ut.test('test_parseModifiers_static', () { | |
4877 final __test = new SimpleParserTest(); | |
4878 runJUnitTest(__test, __test.test_parseModifiers_static); | |
4879 }); | |
4880 _ut.test('test_parseModifiers_var', () { | |
4881 final __test = new SimpleParserTest(); | |
4882 runJUnitTest(__test, __test.test_parseModifiers_var); | |
4883 }); | |
4884 _ut.test('test_parseMultiplicativeExpression_normal', () { | |
4885 final __test = new SimpleParserTest(); | |
4886 runJUnitTest(__test, __test.test_parseMultiplicativeExpression_normal); | |
4887 }); | |
4888 _ut.test('test_parseMultiplicativeExpression_super', () { | |
4889 final __test = new SimpleParserTest(); | |
4890 runJUnitTest(__test, __test.test_parseMultiplicativeExpression_super); | |
4891 }); | |
4892 _ut.test('test_parseNewExpression', () { | |
4893 final __test = new SimpleParserTest(); | |
4894 runJUnitTest(__test, __test.test_parseNewExpression); | |
4895 }); | |
4896 _ut.test('test_parseNonLabeledStatement_const_list_empty', () { | |
4897 final __test = new SimpleParserTest(); | |
4898 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_list_emp
ty); | |
4899 }); | |
4900 _ut.test('test_parseNonLabeledStatement_const_list_nonEmpty', () { | |
4901 final __test = new SimpleParserTest(); | |
4902 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_list_non
Empty); | |
4903 }); | |
4904 _ut.test('test_parseNonLabeledStatement_const_map_empty', () { | |
4905 final __test = new SimpleParserTest(); | |
4906 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_map_empt
y); | |
4907 }); | |
4908 _ut.test('test_parseNonLabeledStatement_const_map_nonEmpty', () { | |
4909 final __test = new SimpleParserTest(); | |
4910 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_map_nonE
mpty); | |
4911 }); | |
4912 _ut.test('test_parseNonLabeledStatement_const_object', () { | |
4913 final __test = new SimpleParserTest(); | |
4914 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_object); | |
4915 }); | |
4916 _ut.test('test_parseNonLabeledStatement_const_object_named_typeParameters'
, () { | |
4917 final __test = new SimpleParserTest(); | |
4918 runJUnitTest(__test, __test.test_parseNonLabeledStatement_const_object_n
amed_typeParameters); | |
4919 }); | |
4920 _ut.test('test_parseNonLabeledStatement_constructorInvocation', () { | |
4921 final __test = new SimpleParserTest(); | |
4922 runJUnitTest(__test, __test.test_parseNonLabeledStatement_constructorInv
ocation); | |
4923 }); | |
4924 _ut.test('test_parseNonLabeledStatement_false', () { | |
4925 final __test = new SimpleParserTest(); | |
4926 runJUnitTest(__test, __test.test_parseNonLabeledStatement_false); | |
4927 }); | |
4928 _ut.test('test_parseNonLabeledStatement_functionDeclaration', () { | |
4929 final __test = new SimpleParserTest(); | |
4930 runJUnitTest(__test, __test.test_parseNonLabeledStatement_functionDeclar
ation); | |
4931 }); | |
4932 _ut.test('test_parseNonLabeledStatement_functionDeclaration_arguments', ()
{ | |
4933 final __test = new SimpleParserTest(); | |
4934 runJUnitTest(__test, __test.test_parseNonLabeledStatement_functionDeclar
ation_arguments); | |
4935 }); | |
4936 _ut.test('test_parseNonLabeledStatement_functionExpressionIndex', () { | |
4937 final __test = new SimpleParserTest(); | |
4938 runJUnitTest(__test, __test.test_parseNonLabeledStatement_functionExpres
sionIndex); | |
4939 }); | |
4940 _ut.test('test_parseNonLabeledStatement_functionInvocation', () { | |
4941 final __test = new SimpleParserTest(); | |
4942 runJUnitTest(__test, __test.test_parseNonLabeledStatement_functionInvoca
tion); | |
4943 }); | |
4944 _ut.test('test_parseNonLabeledStatement_invokeFunctionExpression', () { | |
4945 final __test = new SimpleParserTest(); | |
4946 runJUnitTest(__test, __test.test_parseNonLabeledStatement_invokeFunction
Expression); | |
4947 }); | |
4948 _ut.test('test_parseNonLabeledStatement_null', () { | |
4949 final __test = new SimpleParserTest(); | |
4950 runJUnitTest(__test, __test.test_parseNonLabeledStatement_null); | |
4951 }); | |
4952 _ut.test('test_parseNonLabeledStatement_startingWithBuiltInIdentifier', ()
{ | |
4953 final __test = new SimpleParserTest(); | |
4954 runJUnitTest(__test, __test.test_parseNonLabeledStatement_startingWithBu
iltInIdentifier); | |
4955 }); | |
4956 _ut.test('test_parseNonLabeledStatement_true', () { | |
4957 final __test = new SimpleParserTest(); | |
4958 runJUnitTest(__test, __test.test_parseNonLabeledStatement_true); | |
4959 }); | |
4960 _ut.test('test_parseNonLabeledStatement_typeCast', () { | |
4961 final __test = new SimpleParserTest(); | |
4962 runJUnitTest(__test, __test.test_parseNonLabeledStatement_typeCast); | |
4963 }); | |
4964 _ut.test('test_parseNormalFormalParameter_field_const_noType', () { | |
4965 final __test = new SimpleParserTest(); | |
4966 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_const_
noType); | |
4967 }); | |
4968 _ut.test('test_parseNormalFormalParameter_field_const_type', () { | |
4969 final __test = new SimpleParserTest(); | |
4970 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_const_
type); | |
4971 }); | |
4972 _ut.test('test_parseNormalFormalParameter_field_final_noType', () { | |
4973 final __test = new SimpleParserTest(); | |
4974 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_final_
noType); | |
4975 }); | |
4976 _ut.test('test_parseNormalFormalParameter_field_final_type', () { | |
4977 final __test = new SimpleParserTest(); | |
4978 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_final_
type); | |
4979 }); | |
4980 _ut.test('test_parseNormalFormalParameter_field_noType', () { | |
4981 final __test = new SimpleParserTest(); | |
4982 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_noType
); | |
4983 }); | |
4984 _ut.test('test_parseNormalFormalParameter_field_type', () { | |
4985 final __test = new SimpleParserTest(); | |
4986 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_type); | |
4987 }); | |
4988 _ut.test('test_parseNormalFormalParameter_field_var', () { | |
4989 final __test = new SimpleParserTest(); | |
4990 runJUnitTest(__test, __test.test_parseNormalFormalParameter_field_var); | |
4991 }); | |
4992 _ut.test('test_parseNormalFormalParameter_function_noType', () { | |
4993 final __test = new SimpleParserTest(); | |
4994 runJUnitTest(__test, __test.test_parseNormalFormalParameter_function_noT
ype); | |
4995 }); | |
4996 _ut.test('test_parseNormalFormalParameter_function_type', () { | |
4997 final __test = new SimpleParserTest(); | |
4998 runJUnitTest(__test, __test.test_parseNormalFormalParameter_function_typ
e); | |
4999 }); | |
5000 _ut.test('test_parseNormalFormalParameter_function_void', () { | |
5001 final __test = new SimpleParserTest(); | |
5002 runJUnitTest(__test, __test.test_parseNormalFormalParameter_function_voi
d); | |
5003 }); | |
5004 _ut.test('test_parseNormalFormalParameter_simple_const_noType', () { | |
5005 final __test = new SimpleParserTest(); | |
5006 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_const
_noType); | |
5007 }); | |
5008 _ut.test('test_parseNormalFormalParameter_simple_const_type', () { | |
5009 final __test = new SimpleParserTest(); | |
5010 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_const
_type); | |
5011 }); | |
5012 _ut.test('test_parseNormalFormalParameter_simple_final_noType', () { | |
5013 final __test = new SimpleParserTest(); | |
5014 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_final
_noType); | |
5015 }); | |
5016 _ut.test('test_parseNormalFormalParameter_simple_final_type', () { | |
5017 final __test = new SimpleParserTest(); | |
5018 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_final
_type); | |
5019 }); | |
5020 _ut.test('test_parseNormalFormalParameter_simple_noType', () { | |
5021 final __test = new SimpleParserTest(); | |
5022 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_noTyp
e); | |
5023 }); | |
5024 _ut.test('test_parseNormalFormalParameter_simple_type', () { | |
5025 final __test = new SimpleParserTest(); | |
5026 runJUnitTest(__test, __test.test_parseNormalFormalParameter_simple_type)
; | |
5027 }); | |
5028 _ut.test('test_parseOperator', () { | |
5029 final __test = new SimpleParserTest(); | |
5030 runJUnitTest(__test, __test.test_parseOperator); | |
5031 }); | |
5032 _ut.test('test_parseOptionalReturnType', () { | |
5033 final __test = new SimpleParserTest(); | |
5034 runJUnitTest(__test, __test.test_parseOptionalReturnType); | |
5035 }); | |
5036 _ut.test('test_parsePartDirective_part', () { | |
5037 final __test = new SimpleParserTest(); | |
5038 runJUnitTest(__test, __test.test_parsePartDirective_part); | |
5039 }); | |
5040 _ut.test('test_parsePartDirective_partOf', () { | |
5041 final __test = new SimpleParserTest(); | |
5042 runJUnitTest(__test, __test.test_parsePartDirective_partOf); | |
5043 }); | |
5044 _ut.test('test_parsePostfixExpression_decrement', () { | |
5045 final __test = new SimpleParserTest(); | |
5046 runJUnitTest(__test, __test.test_parsePostfixExpression_decrement); | |
5047 }); | |
5048 _ut.test('test_parsePostfixExpression_increment', () { | |
5049 final __test = new SimpleParserTest(); | |
5050 runJUnitTest(__test, __test.test_parsePostfixExpression_increment); | |
5051 }); | |
5052 _ut.test('test_parsePostfixExpression_none_indexExpression', () { | |
5053 final __test = new SimpleParserTest(); | |
5054 runJUnitTest(__test, __test.test_parsePostfixExpression_none_indexExpres
sion); | |
5055 }); | |
5056 _ut.test('test_parsePostfixExpression_none_methodInvocation', () { | |
5057 final __test = new SimpleParserTest(); | |
5058 runJUnitTest(__test, __test.test_parsePostfixExpression_none_methodInvoc
ation); | |
5059 }); | |
5060 _ut.test('test_parsePostfixExpression_none_propertyAccess', () { | |
5061 final __test = new SimpleParserTest(); | |
5062 runJUnitTest(__test, __test.test_parsePostfixExpression_none_propertyAcc
ess); | |
5063 }); | |
5064 _ut.test('test_parsePrefixedIdentifier_noPrefix', () { | |
5065 final __test = new SimpleParserTest(); | |
5066 runJUnitTest(__test, __test.test_parsePrefixedIdentifier_noPrefix); | |
5067 }); | |
5068 _ut.test('test_parsePrefixedIdentifier_prefix', () { | |
5069 final __test = new SimpleParserTest(); | |
5070 runJUnitTest(__test, __test.test_parsePrefixedIdentifier_prefix); | |
5071 }); | |
5072 _ut.test('test_parsePrimaryExpression_argumentDefinitionTest', () { | |
5073 final __test = new SimpleParserTest(); | |
5074 runJUnitTest(__test, __test.test_parsePrimaryExpression_argumentDefiniti
onTest); | |
5075 }); | |
5076 _ut.test('test_parsePrimaryExpression_const', () { | |
5077 final __test = new SimpleParserTest(); | |
5078 runJUnitTest(__test, __test.test_parsePrimaryExpression_const); | |
5079 }); | |
5080 _ut.test('test_parsePrimaryExpression_double', () { | |
5081 final __test = new SimpleParserTest(); | |
5082 runJUnitTest(__test, __test.test_parsePrimaryExpression_double); | |
5083 }); | |
5084 _ut.test('test_parsePrimaryExpression_false', () { | |
5085 final __test = new SimpleParserTest(); | |
5086 runJUnitTest(__test, __test.test_parsePrimaryExpression_false); | |
5087 }); | |
5088 _ut.test('test_parsePrimaryExpression_function_arguments', () { | |
5089 final __test = new SimpleParserTest(); | |
5090 runJUnitTest(__test, __test.test_parsePrimaryExpression_function_argumen
ts); | |
5091 }); | |
5092 _ut.test('test_parsePrimaryExpression_function_noArguments', () { | |
5093 final __test = new SimpleParserTest(); | |
5094 runJUnitTest(__test, __test.test_parsePrimaryExpression_function_noArgum
ents); | |
5095 }); | |
5096 _ut.test('test_parsePrimaryExpression_hex', () { | |
5097 final __test = new SimpleParserTest(); | |
5098 runJUnitTest(__test, __test.test_parsePrimaryExpression_hex); | |
5099 }); | |
5100 _ut.test('test_parsePrimaryExpression_identifier', () { | |
5101 final __test = new SimpleParserTest(); | |
5102 runJUnitTest(__test, __test.test_parsePrimaryExpression_identifier); | |
5103 }); | |
5104 _ut.test('test_parsePrimaryExpression_int', () { | |
5105 final __test = new SimpleParserTest(); | |
5106 runJUnitTest(__test, __test.test_parsePrimaryExpression_int); | |
5107 }); | |
5108 _ut.test('test_parsePrimaryExpression_listLiteral', () { | |
5109 final __test = new SimpleParserTest(); | |
5110 runJUnitTest(__test, __test.test_parsePrimaryExpression_listLiteral); | |
5111 }); | |
5112 _ut.test('test_parsePrimaryExpression_listLiteral_index', () { | |
5113 final __test = new SimpleParserTest(); | |
5114 runJUnitTest(__test, __test.test_parsePrimaryExpression_listLiteral_inde
x); | |
5115 }); | |
5116 _ut.test('test_parsePrimaryExpression_listLiteral_typed', () { | |
5117 final __test = new SimpleParserTest(); | |
5118 runJUnitTest(__test, __test.test_parsePrimaryExpression_listLiteral_type
d); | |
5119 }); | |
5120 _ut.test('test_parsePrimaryExpression_mapLiteral', () { | |
5121 final __test = new SimpleParserTest(); | |
5122 runJUnitTest(__test, __test.test_parsePrimaryExpression_mapLiteral); | |
5123 }); | |
5124 _ut.test('test_parsePrimaryExpression_mapLiteral_typed', () { | |
5125 final __test = new SimpleParserTest(); | |
5126 runJUnitTest(__test, __test.test_parsePrimaryExpression_mapLiteral_typed
); | |
5127 }); | |
5128 _ut.test('test_parsePrimaryExpression_new', () { | |
5129 final __test = new SimpleParserTest(); | |
5130 runJUnitTest(__test, __test.test_parsePrimaryExpression_new); | |
5131 }); | |
5132 _ut.test('test_parsePrimaryExpression_null', () { | |
5133 final __test = new SimpleParserTest(); | |
5134 runJUnitTest(__test, __test.test_parsePrimaryExpression_null); | |
5135 }); | |
5136 _ut.test('test_parsePrimaryExpression_parenthesized', () { | |
5137 final __test = new SimpleParserTest(); | |
5138 runJUnitTest(__test, __test.test_parsePrimaryExpression_parenthesized); | |
5139 }); | |
5140 _ut.test('test_parsePrimaryExpression_string', () { | |
5141 final __test = new SimpleParserTest(); | |
5142 runJUnitTest(__test, __test.test_parsePrimaryExpression_string); | |
5143 }); | |
5144 _ut.test('test_parsePrimaryExpression_super', () { | |
5145 final __test = new SimpleParserTest(); | |
5146 runJUnitTest(__test, __test.test_parsePrimaryExpression_super); | |
5147 }); | |
5148 _ut.test('test_parsePrimaryExpression_this', () { | |
5149 final __test = new SimpleParserTest(); | |
5150 runJUnitTest(__test, __test.test_parsePrimaryExpression_this); | |
5151 }); | |
5152 _ut.test('test_parsePrimaryExpression_true', () { | |
5153 final __test = new SimpleParserTest(); | |
5154 runJUnitTest(__test, __test.test_parsePrimaryExpression_true); | |
5155 }); | |
5156 _ut.test('test_parseRedirectingConstructorInvocation_named', () { | |
5157 final __test = new SimpleParserTest(); | |
5158 runJUnitTest(__test, __test.test_parseRedirectingConstructorInvocation_n
amed); | |
5159 }); | |
5160 _ut.test('test_parseRedirectingConstructorInvocation_unnamed', () { | |
5161 final __test = new SimpleParserTest(); | |
5162 runJUnitTest(__test, __test.test_parseRedirectingConstructorInvocation_u
nnamed); | |
5163 }); | |
5164 _ut.test('test_parseRelationalExpression_as', () { | |
5165 final __test = new SimpleParserTest(); | |
5166 runJUnitTest(__test, __test.test_parseRelationalExpression_as); | |
5167 }); | |
5168 _ut.test('test_parseRelationalExpression_is', () { | |
5169 final __test = new SimpleParserTest(); | |
5170 runJUnitTest(__test, __test.test_parseRelationalExpression_is); | |
5171 }); | |
5172 _ut.test('test_parseRelationalExpression_isNot', () { | |
5173 final __test = new SimpleParserTest(); | |
5174 runJUnitTest(__test, __test.test_parseRelationalExpression_isNot); | |
5175 }); | |
5176 _ut.test('test_parseRelationalExpression_normal', () { | |
5177 final __test = new SimpleParserTest(); | |
5178 runJUnitTest(__test, __test.test_parseRelationalExpression_normal); | |
5179 }); | |
5180 _ut.test('test_parseRelationalExpression_super', () { | |
5181 final __test = new SimpleParserTest(); | |
5182 runJUnitTest(__test, __test.test_parseRelationalExpression_super); | |
5183 }); | |
5184 _ut.test('test_parseReturnStatement_noValue', () { | |
5185 final __test = new SimpleParserTest(); | |
5186 runJUnitTest(__test, __test.test_parseReturnStatement_noValue); | |
5187 }); | |
5188 _ut.test('test_parseReturnStatement_value', () { | |
5189 final __test = new SimpleParserTest(); | |
5190 runJUnitTest(__test, __test.test_parseReturnStatement_value); | |
5191 }); | |
5192 _ut.test('test_parseReturnType_nonVoid', () { | |
5193 final __test = new SimpleParserTest(); | |
5194 runJUnitTest(__test, __test.test_parseReturnType_nonVoid); | |
5195 }); | |
5196 _ut.test('test_parseReturnType_void', () { | |
5197 final __test = new SimpleParserTest(); | |
5198 runJUnitTest(__test, __test.test_parseReturnType_void); | |
5199 }); | |
5200 _ut.test('test_parseSetter_nonStatic', () { | |
5201 final __test = new SimpleParserTest(); | |
5202 runJUnitTest(__test, __test.test_parseSetter_nonStatic); | |
5203 }); | |
5204 _ut.test('test_parseSetter_static', () { | |
5205 final __test = new SimpleParserTest(); | |
5206 runJUnitTest(__test, __test.test_parseSetter_static); | |
5207 }); | |
5208 _ut.test('test_parseShiftExpression_normal', () { | |
5209 final __test = new SimpleParserTest(); | |
5210 runJUnitTest(__test, __test.test_parseShiftExpression_normal); | |
5211 }); | |
5212 _ut.test('test_parseShiftExpression_super', () { | |
5213 final __test = new SimpleParserTest(); | |
5214 runJUnitTest(__test, __test.test_parseShiftExpression_super); | |
5215 }); | |
5216 _ut.test('test_parseSimpleIdentifier1_normalIdentifier', () { | |
5217 final __test = new SimpleParserTest(); | |
5218 runJUnitTest(__test, __test.test_parseSimpleIdentifier1_normalIdentifier
); | |
5219 }); | |
5220 _ut.test('test_parseSimpleIdentifier_builtInIdentifier', () { | |
5221 final __test = new SimpleParserTest(); | |
5222 runJUnitTest(__test, __test.test_parseSimpleIdentifier_builtInIdentifier
); | |
5223 }); | |
5224 _ut.test('test_parseSimpleIdentifier_normalIdentifier', () { | |
5225 final __test = new SimpleParserTest(); | |
5226 runJUnitTest(__test, __test.test_parseSimpleIdentifier_normalIdentifier)
; | |
5227 }); | |
5228 _ut.test('test_parseStatement_functionDeclaration', () { | |
5229 final __test = new SimpleParserTest(); | |
5230 runJUnitTest(__test, __test.test_parseStatement_functionDeclaration); | |
5231 }); | |
5232 _ut.test('test_parseStatement_mulipleLabels', () { | |
5233 final __test = new SimpleParserTest(); | |
5234 runJUnitTest(__test, __test.test_parseStatement_mulipleLabels); | |
5235 }); | |
5236 _ut.test('test_parseStatement_noLabels', () { | |
5237 final __test = new SimpleParserTest(); | |
5238 runJUnitTest(__test, __test.test_parseStatement_noLabels); | |
5239 }); | |
5240 _ut.test('test_parseStatement_singleLabel', () { | |
5241 final __test = new SimpleParserTest(); | |
5242 runJUnitTest(__test, __test.test_parseStatement_singleLabel); | |
5243 }); | |
5244 _ut.test('test_parseStatements_multiple', () { | |
5245 final __test = new SimpleParserTest(); | |
5246 runJUnitTest(__test, __test.test_parseStatements_multiple); | |
5247 }); | |
5248 _ut.test('test_parseStatements_single', () { | |
5249 final __test = new SimpleParserTest(); | |
5250 runJUnitTest(__test, __test.test_parseStatements_single); | |
5251 }); | |
5252 _ut.test('test_parseStringLiteral_adjacent', () { | |
5253 final __test = new SimpleParserTest(); | |
5254 runJUnitTest(__test, __test.test_parseStringLiteral_adjacent); | |
5255 }); | |
5256 _ut.test('test_parseStringLiteral_interpolated', () { | |
5257 final __test = new SimpleParserTest(); | |
5258 runJUnitTest(__test, __test.test_parseStringLiteral_interpolated); | |
5259 }); | |
5260 _ut.test('test_parseStringLiteral_single', () { | |
5261 final __test = new SimpleParserTest(); | |
5262 runJUnitTest(__test, __test.test_parseStringLiteral_single); | |
5263 }); | |
5264 _ut.test('test_parseSuperConstructorInvocation_named', () { | |
5265 final __test = new SimpleParserTest(); | |
5266 runJUnitTest(__test, __test.test_parseSuperConstructorInvocation_named); | |
5267 }); | |
5268 _ut.test('test_parseSuperConstructorInvocation_unnamed', () { | |
5269 final __test = new SimpleParserTest(); | |
5270 runJUnitTest(__test, __test.test_parseSuperConstructorInvocation_unnamed
); | |
5271 }); | |
5272 _ut.test('test_parseSwitchStatement_case', () { | |
5273 final __test = new SimpleParserTest(); | |
5274 runJUnitTest(__test, __test.test_parseSwitchStatement_case); | |
5275 }); | |
5276 _ut.test('test_parseSwitchStatement_empty', () { | |
5277 final __test = new SimpleParserTest(); | |
5278 runJUnitTest(__test, __test.test_parseSwitchStatement_empty); | |
5279 }); | |
5280 _ut.test('test_parseSwitchStatement_labeledCase', () { | |
5281 final __test = new SimpleParserTest(); | |
5282 runJUnitTest(__test, __test.test_parseSwitchStatement_labeledCase); | |
5283 }); | |
5284 _ut.test('test_parseSwitchStatement_labeledStatementInCase', () { | |
5285 final __test = new SimpleParserTest(); | |
5286 runJUnitTest(__test, __test.test_parseSwitchStatement_labeledStatementIn
Case); | |
5287 }); | |
5288 _ut.test('test_parseThrowExpressionWithoutCascade_expression', () { | |
5289 final __test = new SimpleParserTest(); | |
5290 runJUnitTest(__test, __test.test_parseThrowExpressionWithoutCascade_expr
ession); | |
5291 }); | |
5292 _ut.test('test_parseThrowExpressionWithoutCascade_noExpression', () { | |
5293 final __test = new SimpleParserTest(); | |
5294 runJUnitTest(__test, __test.test_parseThrowExpressionWithoutCascade_noEx
pression); | |
5295 }); | |
5296 _ut.test('test_parseThrowExpression_expression', () { | |
5297 final __test = new SimpleParserTest(); | |
5298 runJUnitTest(__test, __test.test_parseThrowExpression_expression); | |
5299 }); | |
5300 _ut.test('test_parseThrowExpression_noExpression', () { | |
5301 final __test = new SimpleParserTest(); | |
5302 runJUnitTest(__test, __test.test_parseThrowExpression_noExpression); | |
5303 }); | |
5304 _ut.test('test_parseTryStatement_catch', () { | |
5305 final __test = new SimpleParserTest(); | |
5306 runJUnitTest(__test, __test.test_parseTryStatement_catch); | |
5307 }); | |
5308 _ut.test('test_parseTryStatement_catch_finally', () { | |
5309 final __test = new SimpleParserTest(); | |
5310 runJUnitTest(__test, __test.test_parseTryStatement_catch_finally); | |
5311 }); | |
5312 _ut.test('test_parseTryStatement_finally', () { | |
5313 final __test = new SimpleParserTest(); | |
5314 runJUnitTest(__test, __test.test_parseTryStatement_finally); | |
5315 }); | |
5316 _ut.test('test_parseTryStatement_multiple', () { | |
5317 final __test = new SimpleParserTest(); | |
5318 runJUnitTest(__test, __test.test_parseTryStatement_multiple); | |
5319 }); | |
5320 _ut.test('test_parseTryStatement_on', () { | |
5321 final __test = new SimpleParserTest(); | |
5322 runJUnitTest(__test, __test.test_parseTryStatement_on); | |
5323 }); | |
5324 _ut.test('test_parseTryStatement_on_catch', () { | |
5325 final __test = new SimpleParserTest(); | |
5326 runJUnitTest(__test, __test.test_parseTryStatement_on_catch); | |
5327 }); | |
5328 _ut.test('test_parseTryStatement_on_catch_finally', () { | |
5329 final __test = new SimpleParserTest(); | |
5330 runJUnitTest(__test, __test.test_parseTryStatement_on_catch_finally); | |
5331 }); | |
5332 _ut.test('test_parseTypeAlias_class_implementsC', () { | |
5333 final __test = new SimpleParserTest(); | |
5334 runJUnitTest(__test, __test.test_parseTypeAlias_class_implementsC); | |
5335 }); | |
5336 _ut.test('test_parseTypeAlias_class_withB', () { | |
5337 final __test = new SimpleParserTest(); | |
5338 runJUnitTest(__test, __test.test_parseTypeAlias_class_withB); | |
5339 }); | |
5340 _ut.test('test_parseTypeAlias_function_noParameters', () { | |
5341 final __test = new SimpleParserTest(); | |
5342 runJUnitTest(__test, __test.test_parseTypeAlias_function_noParameters); | |
5343 }); | |
5344 _ut.test('test_parseTypeAlias_function_noReturnType', () { | |
5345 final __test = new SimpleParserTest(); | |
5346 runJUnitTest(__test, __test.test_parseTypeAlias_function_noReturnType); | |
5347 }); | |
5348 _ut.test('test_parseTypeAlias_function_parameterizedReturnType', () { | |
5349 final __test = new SimpleParserTest(); | |
5350 runJUnitTest(__test, __test.test_parseTypeAlias_function_parameterizedRe
turnType); | |
5351 }); | |
5352 _ut.test('test_parseTypeAlias_function_parameters', () { | |
5353 final __test = new SimpleParserTest(); | |
5354 runJUnitTest(__test, __test.test_parseTypeAlias_function_parameters); | |
5355 }); | |
5356 _ut.test('test_parseTypeAlias_function_typeParameters', () { | |
5357 final __test = new SimpleParserTest(); | |
5358 runJUnitTest(__test, __test.test_parseTypeAlias_function_typeParameters)
; | |
5359 }); | |
5360 _ut.test('test_parseTypeAlias_function_voidReturnType', () { | |
5361 final __test = new SimpleParserTest(); | |
5362 runJUnitTest(__test, __test.test_parseTypeAlias_function_voidReturnType)
; | |
5363 }); | |
5364 _ut.test('test_parseTypeArgumentList_multiple', () { | |
5365 final __test = new SimpleParserTest(); | |
5366 runJUnitTest(__test, __test.test_parseTypeArgumentList_multiple); | |
5367 }); | |
5368 _ut.test('test_parseTypeArgumentList_nested', () { | |
5369 final __test = new SimpleParserTest(); | |
5370 runJUnitTest(__test, __test.test_parseTypeArgumentList_nested); | |
5371 }); | |
5372 _ut.test('test_parseTypeArgumentList_single', () { | |
5373 final __test = new SimpleParserTest(); | |
5374 runJUnitTest(__test, __test.test_parseTypeArgumentList_single); | |
5375 }); | |
5376 _ut.test('test_parseTypeName_parameterized', () { | |
5377 final __test = new SimpleParserTest(); | |
5378 runJUnitTest(__test, __test.test_parseTypeName_parameterized); | |
5379 }); | |
5380 _ut.test('test_parseTypeName_simple', () { | |
5381 final __test = new SimpleParserTest(); | |
5382 runJUnitTest(__test, __test.test_parseTypeName_simple); | |
5383 }); | |
5384 _ut.test('test_parseTypeParameterList_multiple', () { | |
5385 final __test = new SimpleParserTest(); | |
5386 runJUnitTest(__test, __test.test_parseTypeParameterList_multiple); | |
5387 }); | |
5388 _ut.test('test_parseTypeParameterList_parameterizedWithTrailingEquals', ()
{ | |
5389 final __test = new SimpleParserTest(); | |
5390 runJUnitTest(__test, __test.test_parseTypeParameterList_parameterizedWit
hTrailingEquals); | |
5391 }); | |
5392 _ut.test('test_parseTypeParameterList_single', () { | |
5393 final __test = new SimpleParserTest(); | |
5394 runJUnitTest(__test, __test.test_parseTypeParameterList_single); | |
5395 }); | |
5396 _ut.test('test_parseTypeParameterList_withTrailingEquals', () { | |
5397 final __test = new SimpleParserTest(); | |
5398 runJUnitTest(__test, __test.test_parseTypeParameterList_withTrailingEqua
ls); | |
5399 }); | |
5400 _ut.test('test_parseTypeParameter_bounded', () { | |
5401 final __test = new SimpleParserTest(); | |
5402 runJUnitTest(__test, __test.test_parseTypeParameter_bounded); | |
5403 }); | |
5404 _ut.test('test_parseTypeParameter_simple', () { | |
5405 final __test = new SimpleParserTest(); | |
5406 runJUnitTest(__test, __test.test_parseTypeParameter_simple); | |
5407 }); | |
5408 _ut.test('test_parseUnaryExpression_decrement_normal', () { | |
5409 final __test = new SimpleParserTest(); | |
5410 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_normal); | |
5411 }); | |
5412 _ut.test('test_parseUnaryExpression_decrement_super', () { | |
5413 final __test = new SimpleParserTest(); | |
5414 runJUnitTest(__test, __test.test_parseUnaryExpression_decrement_super); | |
5415 }); | |
5416 _ut.test('test_parseUnaryExpression_increment_normal', () { | |
5417 final __test = new SimpleParserTest(); | |
5418 runJUnitTest(__test, __test.test_parseUnaryExpression_increment_normal); | |
5419 }); | |
5420 _ut.test('test_parseUnaryExpression_minus_normal', () { | |
5421 final __test = new SimpleParserTest(); | |
5422 runJUnitTest(__test, __test.test_parseUnaryExpression_minus_normal); | |
5423 }); | |
5424 _ut.test('test_parseUnaryExpression_minus_super', () { | |
5425 final __test = new SimpleParserTest(); | |
5426 runJUnitTest(__test, __test.test_parseUnaryExpression_minus_super); | |
5427 }); | |
5428 _ut.test('test_parseUnaryExpression_not_normal', () { | |
5429 final __test = new SimpleParserTest(); | |
5430 runJUnitTest(__test, __test.test_parseUnaryExpression_not_normal); | |
5431 }); | |
5432 _ut.test('test_parseUnaryExpression_not_super', () { | |
5433 final __test = new SimpleParserTest(); | |
5434 runJUnitTest(__test, __test.test_parseUnaryExpression_not_super); | |
5435 }); | |
5436 _ut.test('test_parseUnaryExpression_tilda_normal', () { | |
5437 final __test = new SimpleParserTest(); | |
5438 runJUnitTest(__test, __test.test_parseUnaryExpression_tilda_normal); | |
5439 }); | |
5440 _ut.test('test_parseUnaryExpression_tilda_super', () { | |
5441 final __test = new SimpleParserTest(); | |
5442 runJUnitTest(__test, __test.test_parseUnaryExpression_tilda_super); | |
5443 }); | |
5444 _ut.test('test_parseVariableDeclarationList2_type', () { | |
5445 final __test = new SimpleParserTest(); | |
5446 runJUnitTest(__test, __test.test_parseVariableDeclarationList2_type); | |
5447 }); | |
5448 _ut.test('test_parseVariableDeclarationList2_var', () { | |
5449 final __test = new SimpleParserTest(); | |
5450 runJUnitTest(__test, __test.test_parseVariableDeclarationList2_var); | |
5451 }); | |
5452 _ut.test('test_parseVariableDeclarationList_const_noType', () { | |
5453 final __test = new SimpleParserTest(); | |
5454 runJUnitTest(__test, __test.test_parseVariableDeclarationList_const_noTy
pe); | |
5455 }); | |
5456 _ut.test('test_parseVariableDeclarationList_const_type', () { | |
5457 final __test = new SimpleParserTest(); | |
5458 runJUnitTest(__test, __test.test_parseVariableDeclarationList_const_type
); | |
5459 }); | |
5460 _ut.test('test_parseVariableDeclarationList_final_noType', () { | |
5461 final __test = new SimpleParserTest(); | |
5462 runJUnitTest(__test, __test.test_parseVariableDeclarationList_final_noTy
pe); | |
5463 }); | |
5464 _ut.test('test_parseVariableDeclarationList_final_type', () { | |
5465 final __test = new SimpleParserTest(); | |
5466 runJUnitTest(__test, __test.test_parseVariableDeclarationList_final_type
); | |
5467 }); | |
5468 _ut.test('test_parseVariableDeclarationList_type_multiple', () { | |
5469 final __test = new SimpleParserTest(); | |
5470 runJUnitTest(__test, __test.test_parseVariableDeclarationList_type_multi
ple); | |
5471 }); | |
5472 _ut.test('test_parseVariableDeclarationList_type_single', () { | |
5473 final __test = new SimpleParserTest(); | |
5474 runJUnitTest(__test, __test.test_parseVariableDeclarationList_type_singl
e); | |
5475 }); | |
5476 _ut.test('test_parseVariableDeclarationList_var_multiple', () { | |
5477 final __test = new SimpleParserTest(); | |
5478 runJUnitTest(__test, __test.test_parseVariableDeclarationList_var_multip
le); | |
5479 }); | |
5480 _ut.test('test_parseVariableDeclarationList_var_single', () { | |
5481 final __test = new SimpleParserTest(); | |
5482 runJUnitTest(__test, __test.test_parseVariableDeclarationList_var_single
); | |
5483 }); | |
5484 _ut.test('test_parseVariableDeclarationStatement_multiple', () { | |
5485 final __test = new SimpleParserTest(); | |
5486 runJUnitTest(__test, __test.test_parseVariableDeclarationStatement_multi
ple); | |
5487 }); | |
5488 _ut.test('test_parseVariableDeclarationStatement_single', () { | |
5489 final __test = new SimpleParserTest(); | |
5490 runJUnitTest(__test, __test.test_parseVariableDeclarationStatement_singl
e); | |
5491 }); | |
5492 _ut.test('test_parseVariableDeclaration_equals', () { | |
5493 final __test = new SimpleParserTest(); | |
5494 runJUnitTest(__test, __test.test_parseVariableDeclaration_equals); | |
5495 }); | |
5496 _ut.test('test_parseVariableDeclaration_noEquals', () { | |
5497 final __test = new SimpleParserTest(); | |
5498 runJUnitTest(__test, __test.test_parseVariableDeclaration_noEquals); | |
5499 }); | |
5500 _ut.test('test_parseWhileStatement', () { | |
5501 final __test = new SimpleParserTest(); | |
5502 runJUnitTest(__test, __test.test_parseWhileStatement); | |
5503 }); | |
5504 _ut.test('test_parseWithClause_multiple', () { | |
5505 final __test = new SimpleParserTest(); | |
5506 runJUnitTest(__test, __test.test_parseWithClause_multiple); | |
5507 }); | |
5508 _ut.test('test_parseWithClause_single', () { | |
5509 final __test = new SimpleParserTest(); | |
5510 runJUnitTest(__test, __test.test_parseWithClause_single); | |
5511 }); | |
5512 _ut.test('test_skipPrefixedIdentifier_invalid', () { | |
5513 final __test = new SimpleParserTest(); | |
5514 runJUnitTest(__test, __test.test_skipPrefixedIdentifier_invalid); | |
5515 }); | |
5516 _ut.test('test_skipPrefixedIdentifier_notPrefixed', () { | |
5517 final __test = new SimpleParserTest(); | |
5518 runJUnitTest(__test, __test.test_skipPrefixedIdentifier_notPrefixed); | |
5519 }); | |
5520 _ut.test('test_skipPrefixedIdentifier_prefixed', () { | |
5521 final __test = new SimpleParserTest(); | |
5522 runJUnitTest(__test, __test.test_skipPrefixedIdentifier_prefixed); | |
5523 }); | |
5524 _ut.test('test_skipReturnType_invalid', () { | |
5525 final __test = new SimpleParserTest(); | |
5526 runJUnitTest(__test, __test.test_skipReturnType_invalid); | |
5527 }); | |
5528 _ut.test('test_skipReturnType_type', () { | |
5529 final __test = new SimpleParserTest(); | |
5530 runJUnitTest(__test, __test.test_skipReturnType_type); | |
5531 }); | |
5532 _ut.test('test_skipReturnType_void', () { | |
5533 final __test = new SimpleParserTest(); | |
5534 runJUnitTest(__test, __test.test_skipReturnType_void); | |
5535 }); | |
5536 _ut.test('test_skipSimpleIdentifier_identifier', () { | |
5537 final __test = new SimpleParserTest(); | |
5538 runJUnitTest(__test, __test.test_skipSimpleIdentifier_identifier); | |
5539 }); | |
5540 _ut.test('test_skipSimpleIdentifier_invalid', () { | |
5541 final __test = new SimpleParserTest(); | |
5542 runJUnitTest(__test, __test.test_skipSimpleIdentifier_invalid); | |
5543 }); | |
5544 _ut.test('test_skipSimpleIdentifier_pseudoKeyword', () { | |
5545 final __test = new SimpleParserTest(); | |
5546 runJUnitTest(__test, __test.test_skipSimpleIdentifier_pseudoKeyword); | |
5547 }); | |
5548 _ut.test('test_skipStringLiteral_adjacent', () { | |
5549 final __test = new SimpleParserTest(); | |
5550 runJUnitTest(__test, __test.test_skipStringLiteral_adjacent); | |
5551 }); | |
5552 _ut.test('test_skipStringLiteral_interpolated', () { | |
5553 final __test = new SimpleParserTest(); | |
5554 runJUnitTest(__test, __test.test_skipStringLiteral_interpolated); | |
5555 }); | |
5556 _ut.test('test_skipStringLiteral_invalid', () { | |
5557 final __test = new SimpleParserTest(); | |
5558 runJUnitTest(__test, __test.test_skipStringLiteral_invalid); | |
5559 }); | |
5560 _ut.test('test_skipStringLiteral_single', () { | |
5561 final __test = new SimpleParserTest(); | |
5562 runJUnitTest(__test, __test.test_skipStringLiteral_single); | |
5563 }); | |
5564 _ut.test('test_skipTypeArgumentList_invalid', () { | |
5565 final __test = new SimpleParserTest(); | |
5566 runJUnitTest(__test, __test.test_skipTypeArgumentList_invalid); | |
5567 }); | |
5568 _ut.test('test_skipTypeArgumentList_multiple', () { | |
5569 final __test = new SimpleParserTest(); | |
5570 runJUnitTest(__test, __test.test_skipTypeArgumentList_multiple); | |
5571 }); | |
5572 _ut.test('test_skipTypeArgumentList_single', () { | |
5573 final __test = new SimpleParserTest(); | |
5574 runJUnitTest(__test, __test.test_skipTypeArgumentList_single); | |
5575 }); | |
5576 _ut.test('test_skipTypeName_invalid', () { | |
5577 final __test = new SimpleParserTest(); | |
5578 runJUnitTest(__test, __test.test_skipTypeName_invalid); | |
5579 }); | |
5580 _ut.test('test_skipTypeName_parameterized', () { | |
5581 final __test = new SimpleParserTest(); | |
5582 runJUnitTest(__test, __test.test_skipTypeName_parameterized); | |
5583 }); | |
5584 _ut.test('test_skipTypeName_simple', () { | |
5585 final __test = new SimpleParserTest(); | |
5586 runJUnitTest(__test, __test.test_skipTypeName_simple); | |
5587 }); | |
5588 }); | |
5589 } | |
5590 } | |
5591 class AnalysisErrorListener_13 implements AnalysisErrorListener { | |
5592 void onError(AnalysisError event) { | |
5593 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); | |
5594 } | |
5595 } | |
5596 /** | |
5597 * The class {@code ComplexParserTest} defines parser tests that test the parsin
g of more complex | |
5598 * code fragments or the interactions between multiple parsing methods. For exam
ple, tests to ensure | |
5599 * that the precedence of operations is being handled correctly should be define
d in this class. | |
5600 * <p> | |
5601 * Simpler tests should be defined in the class {@link SimpleParserTest}. | |
5602 */ | |
5603 class ComplexParserTest extends ParserTestCase { | |
5604 void test_additiveExpression_normal() { | |
5605 BinaryExpression expression = ParserTestCase.parseExpression("x + y - z", []
); | |
5606 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5607 } | |
5608 void test_additiveExpression_noSpaces() { | |
5609 BinaryExpression expression = ParserTestCase.parseExpression("i+1", []); | |
5610 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
5611 EngineTestCase.assertInstanceOf(IntegerLiteral, expression.rightOperand); | |
5612 } | |
5613 void test_additiveExpression_precedence_multiplicative_left() { | |
5614 BinaryExpression expression = ParserTestCase.parseExpression("x * y + z", []
); | |
5615 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5616 } | |
5617 void test_additiveExpression_precedence_multiplicative_left_withSuper() { | |
5618 BinaryExpression expression = ParserTestCase.parseExpression("super * y - z"
, []); | |
5619 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5620 } | |
5621 void test_additiveExpression_precedence_multiplicative_right() { | |
5622 BinaryExpression expression = ParserTestCase.parseExpression("x + y * z", []
); | |
5623 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
5624 } | |
5625 void test_additiveExpression_super() { | |
5626 BinaryExpression expression = ParserTestCase.parseExpression("super + y - z"
, []); | |
5627 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5628 } | |
5629 void test_assignableExpression_arguments_normal_chain() { | |
5630 PropertyAccess propertyAccess1 = ParserTestCase.parseExpression("a(b)(c).d(e
).f", []); | |
5631 JUnitTestCase.assertEquals("f", propertyAccess1.propertyName.name); | |
5632 MethodInvocation invocation2 = EngineTestCase.assertInstanceOf(MethodInvocat
ion, propertyAccess1.target); | |
5633 JUnitTestCase.assertEquals("d", invocation2.methodName.name); | |
5634 ArgumentList argumentList2 = invocation2.argumentList; | |
5635 JUnitTestCase.assertNotNull(argumentList2); | |
5636 EngineTestCase.assertSize(1, argumentList2.arguments); | |
5637 FunctionExpressionInvocation invocation3 = EngineTestCase.assertInstanceOf(F
unctionExpressionInvocation, invocation2.target); | |
5638 ArgumentList argumentList3 = invocation3.argumentList; | |
5639 JUnitTestCase.assertNotNull(argumentList3); | |
5640 EngineTestCase.assertSize(1, argumentList3.arguments); | |
5641 MethodInvocation invocation4 = EngineTestCase.assertInstanceOf(MethodInvocat
ion, invocation3.function); | |
5642 JUnitTestCase.assertEquals("a", invocation4.methodName.name); | |
5643 ArgumentList argumentList4 = invocation4.argumentList; | |
5644 JUnitTestCase.assertNotNull(argumentList4); | |
5645 EngineTestCase.assertSize(1, argumentList4.arguments); | |
5646 } | |
5647 void test_assignmentExpression_compound() { | |
5648 AssignmentExpression expression = ParserTestCase.parseExpression("x = y = 0"
, []); | |
5649 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); | |
5650 EngineTestCase.assertInstanceOf(AssignmentExpression, expression.rightHandSi
de); | |
5651 } | |
5652 void test_assignmentExpression_indexExpression() { | |
5653 AssignmentExpression expression = ParserTestCase.parseExpression("x[1] = 0",
[]); | |
5654 EngineTestCase.assertInstanceOf(IndexExpression, expression.leftHandSide); | |
5655 EngineTestCase.assertInstanceOf(IntegerLiteral, expression.rightHandSide); | |
5656 } | |
5657 void test_assignmentExpression_prefixedIdentifier() { | |
5658 AssignmentExpression expression = ParserTestCase.parseExpression("x.y = 0",
[]); | |
5659 EngineTestCase.assertInstanceOf(PrefixedIdentifier, expression.leftHandSide)
; | |
5660 EngineTestCase.assertInstanceOf(IntegerLiteral, expression.rightHandSide); | |
5661 } | |
5662 void test_assignmentExpression_propertyAccess() { | |
5663 AssignmentExpression expression = ParserTestCase.parseExpression("super.y =
0", []); | |
5664 EngineTestCase.assertInstanceOf(PropertyAccess, expression.leftHandSide); | |
5665 EngineTestCase.assertInstanceOf(IntegerLiteral, expression.rightHandSide); | |
5666 } | |
5667 void test_bitwiseAndExpression_normal() { | |
5668 BinaryExpression expression = ParserTestCase.parseExpression("x & y & z", []
); | |
5669 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5670 } | |
5671 void test_bitwiseAndExpression_precedence_equality_left() { | |
5672 BinaryExpression expression = ParserTestCase.parseExpression("x == y & z", [
]); | |
5673 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5674 } | |
5675 void test_bitwiseAndExpression_precedence_equality_right() { | |
5676 BinaryExpression expression = ParserTestCase.parseExpression("x & y == z", [
]); | |
5677 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
5678 } | |
5679 void test_bitwiseAndExpression_super() { | |
5680 BinaryExpression expression = ParserTestCase.parseExpression("super & y & z"
, []); | |
5681 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5682 } | |
5683 void test_bitwiseOrExpression_normal() { | |
5684 BinaryExpression expression = ParserTestCase.parseExpression("x | y | z", []
); | |
5685 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5686 } | |
5687 void test_bitwiseOrExpression_precedence_xor_left() { | |
5688 BinaryExpression expression = ParserTestCase.parseExpression("x ^ y | z", []
); | |
5689 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5690 } | |
5691 void test_bitwiseOrExpression_precedence_xor_right() { | |
5692 BinaryExpression expression = ParserTestCase.parseExpression("x | y ^ z", []
); | |
5693 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
5694 } | |
5695 void test_bitwiseOrExpression_super() { | |
5696 BinaryExpression expression = ParserTestCase.parseExpression("super | y | z"
, []); | |
5697 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5698 } | |
5699 void test_bitwiseXorExpression_normal() { | |
5700 BinaryExpression expression = ParserTestCase.parseExpression("x ^ y ^ z", []
); | |
5701 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5702 } | |
5703 void test_bitwiseXorExpression_precedence_and_left() { | |
5704 BinaryExpression expression = ParserTestCase.parseExpression("x & y ^ z", []
); | |
5705 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5706 } | |
5707 void test_bitwiseXorExpression_precedence_and_right() { | |
5708 BinaryExpression expression = ParserTestCase.parseExpression("x ^ y & z", []
); | |
5709 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
5710 } | |
5711 void test_bitwiseXorExpression_super() { | |
5712 BinaryExpression expression = ParserTestCase.parseExpression("super ^ y ^ z"
, []); | |
5713 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5714 } | |
5715 void test_conditionalExpression_precedence_argumentDefinitionTest_not() { | |
5716 ConditionalExpression conditional = ParserTestCase.parseExpression("!?a?!?b:
!?c", []); | |
5717 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.condition); | |
5718 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, ((conditional.condit
ion as PrefixExpression)).operand); | |
5719 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.thenExpression
); | |
5720 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, ((conditional.thenEx
pression as PrefixExpression)).operand); | |
5721 EngineTestCase.assertInstanceOf(PrefixExpression, conditional.elseExpression
); | |
5722 EngineTestCase.assertInstanceOf(ArgumentDefinitionTest, ((conditional.elseEx
pression as PrefixExpression)).operand); | |
5723 } | |
5724 void test_conditionalExpression_precedence_logicalOrExpression() { | |
5725 ConditionalExpression expression = ParserTestCase.parseExpression("a | b ? y
: z", []); | |
5726 EngineTestCase.assertInstanceOf(BinaryExpression, expression.condition); | |
5727 } | |
5728 void test_constructor_initializer_withParenthesizedExpression() { | |
5729 CompilationUnit unit = ParserTestCase.parseCompilationUnit(EngineTestCase.cr
eateSource(["class C {", " C() :", " this.a = (b == null ? c : d) {", " }",
"}"]), []); | |
5730 NodeList<CompilationUnitMember> declarations2 = unit.declarations; | |
5731 EngineTestCase.assertSize(1, declarations2); | |
5732 } | |
5733 void test_equalityExpression_normal() { | |
5734 BinaryExpression expression = ParserTestCase.parseExpression("x == y != z",
[]); | |
5735 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5736 } | |
5737 void test_equalityExpression_precedence_relational_left() { | |
5738 BinaryExpression expression = ParserTestCase.parseExpression("x is y == z",
[]); | |
5739 EngineTestCase.assertInstanceOf(IsExpression, expression.leftOperand); | |
5740 } | |
5741 void test_equalityExpression_precedence_relational_right() { | |
5742 BinaryExpression expression = ParserTestCase.parseExpression("x == y is z",
[]); | |
5743 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); | |
5744 } | |
5745 void test_equalityExpression_super() { | |
5746 BinaryExpression expression = ParserTestCase.parseExpression("super == y !=
z", []); | |
5747 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5748 } | |
5749 void test_logicalAndExpression() { | |
5750 BinaryExpression expression = ParserTestCase.parseExpression("x && y && z",
[]); | |
5751 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5752 } | |
5753 void test_logicalAndExpression_precedence_bitwiseOr_left() { | |
5754 BinaryExpression expression = ParserTestCase.parseExpression("x | y && z", [
]); | |
5755 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5756 } | |
5757 void test_logicalAndExpression_precedence_bitwiseOr_right() { | |
5758 BinaryExpression expression = ParserTestCase.parseExpression("x && y | z", [
]); | |
5759 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
5760 } | |
5761 void test_logicalOrExpression() { | |
5762 BinaryExpression expression = ParserTestCase.parseExpression("x || y || z",
[]); | |
5763 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5764 } | |
5765 void test_logicalOrExpression_precedence_logicalAnd_left() { | |
5766 BinaryExpression expression = ParserTestCase.parseExpression("x && y || z",
[]); | |
5767 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5768 } | |
5769 void test_logicalOrExpression_precedence_logicalAnd_right() { | |
5770 BinaryExpression expression = ParserTestCase.parseExpression("x || y && z",
[]); | |
5771 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
5772 } | |
5773 void test_multipleLabels_statement() { | |
5774 LabeledStatement statement = ParserTestCase.parseStatement("a: b: c: return
x;", []); | |
5775 EngineTestCase.assertSize(3, statement.labels); | |
5776 EngineTestCase.assertInstanceOf(ReturnStatement, statement.statement); | |
5777 } | |
5778 void test_multiplicativeExpression_normal() { | |
5779 BinaryExpression expression = ParserTestCase.parseExpression("x * y / z", []
); | |
5780 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5781 } | |
5782 void test_multiplicativeExpression_precedence_unary_left() { | |
5783 BinaryExpression expression = ParserTestCase.parseExpression("-x * y", []); | |
5784 EngineTestCase.assertInstanceOf(PrefixExpression, expression.leftOperand); | |
5785 } | |
5786 void test_multiplicativeExpression_precedence_unary_right() { | |
5787 BinaryExpression expression = ParserTestCase.parseExpression("x * -y", []); | |
5788 EngineTestCase.assertInstanceOf(PrefixExpression, expression.rightOperand); | |
5789 } | |
5790 void test_multiplicativeExpression_super() { | |
5791 BinaryExpression expression = ParserTestCase.parseExpression("super * y / z"
, []); | |
5792 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5793 } | |
5794 void test_relationalExpression_precedence_shift_right() { | |
5795 IsExpression expression = ParserTestCase.parseExpression("x << y is z", []); | |
5796 EngineTestCase.assertInstanceOf(BinaryExpression, expression.expression); | |
5797 } | |
5798 void test_shiftExpression_normal() { | |
5799 BinaryExpression expression = ParserTestCase.parseExpression("x >> 4 << 3",
[]); | |
5800 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5801 } | |
5802 void test_shiftExpression_precedence_additive_left() { | |
5803 BinaryExpression expression = ParserTestCase.parseExpression("x + y << z", [
]); | |
5804 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5805 } | |
5806 void test_shiftExpression_precedence_additive_right() { | |
5807 BinaryExpression expression = ParserTestCase.parseExpression("x << y + z", [
]); | |
5808 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
5809 } | |
5810 void test_shiftExpression_super() { | |
5811 BinaryExpression expression = ParserTestCase.parseExpression("super >> 4 <<
3", []); | |
5812 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
5813 } | |
5814 static dartSuite() { | |
5815 _ut.group('ComplexParserTest', () { | |
5816 _ut.test('test_additiveExpression_noSpaces', () { | |
5817 final __test = new ComplexParserTest(); | |
5818 runJUnitTest(__test, __test.test_additiveExpression_noSpaces); | |
5819 }); | |
5820 _ut.test('test_additiveExpression_normal', () { | |
5821 final __test = new ComplexParserTest(); | |
5822 runJUnitTest(__test, __test.test_additiveExpression_normal); | |
5823 }); | |
5824 _ut.test('test_additiveExpression_precedence_multiplicative_left', () { | |
5825 final __test = new ComplexParserTest(); | |
5826 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_left); | |
5827 }); | |
5828 _ut.test('test_additiveExpression_precedence_multiplicative_left_withSuper
', () { | |
5829 final __test = new ComplexParserTest(); | |
5830 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_left_withSuper); | |
5831 }); | |
5832 _ut.test('test_additiveExpression_precedence_multiplicative_right', () { | |
5833 final __test = new ComplexParserTest(); | |
5834 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_right); | |
5835 }); | |
5836 _ut.test('test_additiveExpression_super', () { | |
5837 final __test = new ComplexParserTest(); | |
5838 runJUnitTest(__test, __test.test_additiveExpression_super); | |
5839 }); | |
5840 _ut.test('test_assignableExpression_arguments_normal_chain', () { | |
5841 final __test = new ComplexParserTest(); | |
5842 runJUnitTest(__test, __test.test_assignableExpression_arguments_normal_c
hain); | |
5843 }); | |
5844 _ut.test('test_assignmentExpression_compound', () { | |
5845 final __test = new ComplexParserTest(); | |
5846 runJUnitTest(__test, __test.test_assignmentExpression_compound); | |
5847 }); | |
5848 _ut.test('test_assignmentExpression_indexExpression', () { | |
5849 final __test = new ComplexParserTest(); | |
5850 runJUnitTest(__test, __test.test_assignmentExpression_indexExpression); | |
5851 }); | |
5852 _ut.test('test_assignmentExpression_prefixedIdentifier', () { | |
5853 final __test = new ComplexParserTest(); | |
5854 runJUnitTest(__test, __test.test_assignmentExpression_prefixedIdentifier
); | |
5855 }); | |
5856 _ut.test('test_assignmentExpression_propertyAccess', () { | |
5857 final __test = new ComplexParserTest(); | |
5858 runJUnitTest(__test, __test.test_assignmentExpression_propertyAccess); | |
5859 }); | |
5860 _ut.test('test_bitwiseAndExpression_normal', () { | |
5861 final __test = new ComplexParserTest(); | |
5862 runJUnitTest(__test, __test.test_bitwiseAndExpression_normal); | |
5863 }); | |
5864 _ut.test('test_bitwiseAndExpression_precedence_equality_left', () { | |
5865 final __test = new ComplexParserTest(); | |
5866 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit
y_left); | |
5867 }); | |
5868 _ut.test('test_bitwiseAndExpression_precedence_equality_right', () { | |
5869 final __test = new ComplexParserTest(); | |
5870 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit
y_right); | |
5871 }); | |
5872 _ut.test('test_bitwiseAndExpression_super', () { | |
5873 final __test = new ComplexParserTest(); | |
5874 runJUnitTest(__test, __test.test_bitwiseAndExpression_super); | |
5875 }); | |
5876 _ut.test('test_bitwiseOrExpression_normal', () { | |
5877 final __test = new ComplexParserTest(); | |
5878 runJUnitTest(__test, __test.test_bitwiseOrExpression_normal); | |
5879 }); | |
5880 _ut.test('test_bitwiseOrExpression_precedence_xor_left', () { | |
5881 final __test = new ComplexParserTest(); | |
5882 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_left
); | |
5883 }); | |
5884 _ut.test('test_bitwiseOrExpression_precedence_xor_right', () { | |
5885 final __test = new ComplexParserTest(); | |
5886 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_righ
t); | |
5887 }); | |
5888 _ut.test('test_bitwiseOrExpression_super', () { | |
5889 final __test = new ComplexParserTest(); | |
5890 runJUnitTest(__test, __test.test_bitwiseOrExpression_super); | |
5891 }); | |
5892 _ut.test('test_bitwiseXorExpression_normal', () { | |
5893 final __test = new ComplexParserTest(); | |
5894 runJUnitTest(__test, __test.test_bitwiseXorExpression_normal); | |
5895 }); | |
5896 _ut.test('test_bitwiseXorExpression_precedence_and_left', () { | |
5897 final __test = new ComplexParserTest(); | |
5898 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_lef
t); | |
5899 }); | |
5900 _ut.test('test_bitwiseXorExpression_precedence_and_right', () { | |
5901 final __test = new ComplexParserTest(); | |
5902 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_rig
ht); | |
5903 }); | |
5904 _ut.test('test_bitwiseXorExpression_super', () { | |
5905 final __test = new ComplexParserTest(); | |
5906 runJUnitTest(__test, __test.test_bitwiseXorExpression_super); | |
5907 }); | |
5908 _ut.test('test_conditionalExpression_precedence_argumentDefinitionTest_not
', () { | |
5909 final __test = new ComplexParserTest(); | |
5910 runJUnitTest(__test, __test.test_conditionalExpression_precedence_argume
ntDefinitionTest_not); | |
5911 }); | |
5912 _ut.test('test_conditionalExpression_precedence_logicalOrExpression', () { | |
5913 final __test = new ComplexParserTest(); | |
5914 runJUnitTest(__test, __test.test_conditionalExpression_precedence_logica
lOrExpression); | |
5915 }); | |
5916 _ut.test('test_constructor_initializer_withParenthesizedExpression', () { | |
5917 final __test = new ComplexParserTest(); | |
5918 runJUnitTest(__test, __test.test_constructor_initializer_withParenthesiz
edExpression); | |
5919 }); | |
5920 _ut.test('test_equalityExpression_normal', () { | |
5921 final __test = new ComplexParserTest(); | |
5922 runJUnitTest(__test, __test.test_equalityExpression_normal); | |
5923 }); | |
5924 _ut.test('test_equalityExpression_precedence_relational_left', () { | |
5925 final __test = new ComplexParserTest(); | |
5926 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa
l_left); | |
5927 }); | |
5928 _ut.test('test_equalityExpression_precedence_relational_right', () { | |
5929 final __test = new ComplexParserTest(); | |
5930 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa
l_right); | |
5931 }); | |
5932 _ut.test('test_equalityExpression_super', () { | |
5933 final __test = new ComplexParserTest(); | |
5934 runJUnitTest(__test, __test.test_equalityExpression_super); | |
5935 }); | |
5936 _ut.test('test_logicalAndExpression', () { | |
5937 final __test = new ComplexParserTest(); | |
5938 runJUnitTest(__test, __test.test_logicalAndExpression); | |
5939 }); | |
5940 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_left', () { | |
5941 final __test = new ComplexParserTest(); | |
5942 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise
Or_left); | |
5943 }); | |
5944 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_right', () { | |
5945 final __test = new ComplexParserTest(); | |
5946 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise
Or_right); | |
5947 }); | |
5948 _ut.test('test_logicalOrExpression', () { | |
5949 final __test = new ComplexParserTest(); | |
5950 runJUnitTest(__test, __test.test_logicalOrExpression); | |
5951 }); | |
5952 _ut.test('test_logicalOrExpression_precedence_logicalAnd_left', () { | |
5953 final __test = new ComplexParserTest(); | |
5954 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA
nd_left); | |
5955 }); | |
5956 _ut.test('test_logicalOrExpression_precedence_logicalAnd_right', () { | |
5957 final __test = new ComplexParserTest(); | |
5958 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA
nd_right); | |
5959 }); | |
5960 _ut.test('test_multipleLabels_statement', () { | |
5961 final __test = new ComplexParserTest(); | |
5962 runJUnitTest(__test, __test.test_multipleLabels_statement); | |
5963 }); | |
5964 _ut.test('test_multiplicativeExpression_normal', () { | |
5965 final __test = new ComplexParserTest(); | |
5966 runJUnitTest(__test, __test.test_multiplicativeExpression_normal); | |
5967 }); | |
5968 _ut.test('test_multiplicativeExpression_precedence_unary_left', () { | |
5969 final __test = new ComplexParserTest(); | |
5970 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una
ry_left); | |
5971 }); | |
5972 _ut.test('test_multiplicativeExpression_precedence_unary_right', () { | |
5973 final __test = new ComplexParserTest(); | |
5974 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una
ry_right); | |
5975 }); | |
5976 _ut.test('test_multiplicativeExpression_super', () { | |
5977 final __test = new ComplexParserTest(); | |
5978 runJUnitTest(__test, __test.test_multiplicativeExpression_super); | |
5979 }); | |
5980 _ut.test('test_relationalExpression_precedence_shift_right', () { | |
5981 final __test = new ComplexParserTest(); | |
5982 runJUnitTest(__test, __test.test_relationalExpression_precedence_shift_r
ight); | |
5983 }); | |
5984 _ut.test('test_shiftExpression_normal', () { | |
5985 final __test = new ComplexParserTest(); | |
5986 runJUnitTest(__test, __test.test_shiftExpression_normal); | |
5987 }); | |
5988 _ut.test('test_shiftExpression_precedence_additive_left', () { | |
5989 final __test = new ComplexParserTest(); | |
5990 runJUnitTest(__test, __test.test_shiftExpression_precedence_additive_lef
t); | |
5991 }); | |
5992 _ut.test('test_shiftExpression_precedence_additive_right', () { | |
5993 final __test = new ComplexParserTest(); | |
5994 runJUnitTest(__test, __test.test_shiftExpression_precedence_additive_rig
ht); | |
5995 }); | |
5996 _ut.test('test_shiftExpression_super', () { | |
5997 final __test = new ComplexParserTest(); | |
5998 runJUnitTest(__test, __test.test_shiftExpression_super); | |
5999 }); | |
6000 }); | |
6001 } | |
6002 } | |
6003 /** | |
6004 * Instances of the class {@code ASTValidator} are used to validate the correct
construction of an | |
6005 * AST structure. | |
6006 */ | |
6007 class ASTValidator extends GeneralizingASTVisitor<Object> { | |
6008 /** | |
6009 * A list containing the errors found while traversing the AST structure. | |
6010 */ | |
6011 List<String> _errors = new List<String>(); | |
6012 /** | |
6013 * Assert that no errors were found while traversing any of the AST structures
that have been | |
6014 * visited. | |
6015 */ | |
6016 void assertValid() { | |
6017 if (!_errors.isEmpty) { | |
6018 JavaStringBuilder builder = new JavaStringBuilder(); | |
6019 builder.append("Invalid AST structure:"); | |
6020 for (String message in _errors) { | |
6021 builder.append("\r\n "); | |
6022 builder.append(message); | |
6023 } | |
6024 JUnitTestCase.fail(builder.toString()); | |
6025 } | |
6026 } | |
6027 Object visitNode(ASTNode node) { | |
6028 validate(node); | |
6029 return super.visitNode(node); | |
6030 } | |
6031 /** | |
6032 * Validate that the given AST node is correctly constructed. | |
6033 * @param node the AST node being validated | |
6034 */ | |
6035 void validate(ASTNode node) { | |
6036 ASTNode parent20 = node.parent; | |
6037 if (node is CompilationUnit) { | |
6038 if (parent20 != null) { | |
6039 _errors.add("Compilation units should not have a parent"); | |
6040 } | |
6041 } else { | |
6042 if (parent20 == null) { | |
6043 _errors.add("No parent for ${node.runtimeType.toString()}"); | |
6044 } | |
6045 } | |
6046 if (node.beginToken == null) { | |
6047 _errors.add("No begin token for ${node.runtimeType.toString()}"); | |
6048 } | |
6049 if (node.endToken == null) { | |
6050 _errors.add("No end token for ${node.runtimeType.toString()}"); | |
6051 } | |
6052 int nodeStart = node.offset; | |
6053 int nodeLength = node.length; | |
6054 if (nodeStart < 0 || nodeLength < 0) { | |
6055 _errors.add("No source info for ${node.runtimeType.toString()}"); | |
6056 } | |
6057 if (parent20 != null) { | |
6058 int nodeEnd = nodeStart + nodeLength; | |
6059 int parentStart = parent20.offset; | |
6060 int parentEnd = parentStart + parent20.length; | |
6061 if (nodeStart < parentStart) { | |
6062 _errors.add("Invalid source start (${nodeStart}) for ${node.runtimeType.
toString()} inside ${parent20.runtimeType.toString()} (${parentStart})"); | |
6063 } | |
6064 if (nodeEnd > parentEnd) { | |
6065 _errors.add("Invalid source end (${nodeEnd}) for ${node.runtimeType.toSt
ring()} inside ${parent20.runtimeType.toString()} (${parentStart})"); | |
6066 } | |
6067 } | |
6068 } | |
6069 } | |
6070 class ParserTestCase extends EngineTestCase { | |
6071 /** | |
6072 * An empty array of objects used as arguments to zero-argument methods. | |
6073 */ | |
6074 static List<Object> _EMPTY_ARGUMENTS = new List<Object>(0); | |
6075 /** | |
6076 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and | |
6077 * type of parameters and will be invoked with the given arguments. | |
6078 * <p> | |
6079 * The given source is scanned and the parser is initialized to start with the
first token in the | |
6080 * source before the parse method is invoked. | |
6081 * @param methodName the name of the parse method that should be invoked to pa
rse the source | |
6082 * @param objects the values of the arguments to the method | |
6083 * @param source the source to be parsed by the parse method | |
6084 * @return the result of invoking the method | |
6085 * @throws Exception if the method could not be invoked or throws an exception | |
6086 * @throws AssertionFailedError if the result is {@code null} or if any errors
are produced | |
6087 */ | |
6088 static Object parse(String methodName, List<Object> objects, String source) =>
parse4(methodName, objects, source, new List<AnalysisError>(0)); | |
6089 /** | |
6090 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and | |
6091 * type of parameters and will be invoked with the given arguments. | |
6092 * <p> | |
6093 * The given source is scanned and the parser is initialized to start with the
first token in the | |
6094 * source before the parse method is invoked. | |
6095 * @param methodName the name of the parse method that should be invoked to pa
rse the source | |
6096 * @param objects the values of the arguments to the method | |
6097 * @param source the source to be parsed by the parse method | |
6098 * @param errorCodes the error codes of the errors that should be generated | |
6099 * @return the result of invoking the method | |
6100 * @throws Exception if the method could not be invoked or throws an exception | |
6101 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
6102 * scanning and parsing the source do not match the expected errors | |
6103 */ | |
6104 static Object parse4(String methodName, List<Object> objects, String source, L
ist<AnalysisError> errors) { | |
6105 GatheringErrorListener listener = new GatheringErrorListener(); | |
6106 Object result = invokeParserMethod(methodName, objects, source, listener); | |
6107 listener.assertErrors(errors); | |
6108 return result; | |
6109 } | |
6110 /** | |
6111 * Invoke a parse method in {@link Parser}. The method is assumed to have the
given number and | |
6112 * type of parameters and will be invoked with the given arguments. | |
6113 * <p> | |
6114 * The given source is scanned and the parser is initialized to start with the
first token in the | |
6115 * source before the parse method is invoked. | |
6116 * @param methodName the name of the parse method that should be invoked to pa
rse the source | |
6117 * @param objects the values of the arguments to the method | |
6118 * @param source the source to be parsed by the parse method | |
6119 * @param errorCodes the error codes of the errors that should be generated | |
6120 * @return the result of invoking the method | |
6121 * @throws Exception if the method could not be invoked or throws an exception | |
6122 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
6123 * scanning and parsing the source do not match the expected errors | |
6124 */ | |
6125 static Object parse5(String methodName, List<Object> objects, String source, L
ist<ErrorCode> errorCodes) { | |
6126 GatheringErrorListener listener = new GatheringErrorListener(); | |
6127 Object result = invokeParserMethod(methodName, objects, source, listener); | |
6128 listener.assertErrors2(errorCodes); | |
6129 return result; | |
6130 } | |
6131 /** | |
6132 * Invoke a parse method in {@link Parser}. The method is assumed to have no a
rguments. | |
6133 * <p> | |
6134 * The given source is scanned and the parser is initialized to start with the
first token in the | |
6135 * source before the parse method is invoked. | |
6136 * @param methodName the name of the parse method that should be invoked to pa
rse the source | |
6137 * @param source the source to be parsed by the parse method | |
6138 * @param errorCodes the error codes of the errors that should be generated | |
6139 * @return the result of invoking the method | |
6140 * @throws Exception if the method could not be invoked or throws an exception | |
6141 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
6142 * scanning and parsing the source do not match the expected errors | |
6143 */ | |
6144 static Object parse6(String methodName, String source, List<ErrorCode> errorCo
des) => parse5(methodName, _EMPTY_ARGUMENTS, source, errorCodes); | |
6145 /** | |
6146 * Parse the given source as a compilation unit. | |
6147 * @param source the source to be parsed | |
6148 * @param errorCodes the error codes of the errors that are expected to be fou
nd | |
6149 * @return the compilation unit that was parsed | |
6150 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do | |
6151 * not match those that are expected, or if the result would have been {@code
null} | |
6152 */ | |
6153 static CompilationUnit parseCompilationUnit(String source, List<ErrorCode> err
orCodes) { | |
6154 GatheringErrorListener listener = new GatheringErrorListener(); | |
6155 StringScanner scanner = new StringScanner(null, source, listener); | |
6156 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
6157 Token token = scanner.tokenize(); | |
6158 Parser parser = new Parser(null, listener); | |
6159 CompilationUnit unit = parser.parseCompilationUnit(token); | |
6160 JUnitTestCase.assertNotNull(unit); | |
6161 listener.assertErrors2(errorCodes); | |
6162 return unit; | |
6163 } | |
6164 /** | |
6165 * Parse the given source as an expression. | |
6166 * @param source the source to be parsed | |
6167 * @param errorCodes the error codes of the errors that are expected to be fou
nd | |
6168 * @return the expression that was parsed | |
6169 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do | |
6170 * not match those that are expected, or if the result would have been {@code
null} | |
6171 */ | |
6172 static Expression parseExpression(String source, List<ErrorCode> errorCodes) { | |
6173 GatheringErrorListener listener = new GatheringErrorListener(); | |
6174 StringScanner scanner = new StringScanner(null, source, listener); | |
6175 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
6176 Token token = scanner.tokenize(); | |
6177 Parser parser = new Parser(null, listener); | |
6178 Expression expression = parser.parseExpression(token); | |
6179 JUnitTestCase.assertNotNull(expression); | |
6180 listener.assertErrors2(errorCodes); | |
6181 return expression as Expression; | |
6182 } | |
6183 /** | |
6184 * Parse the given source as a statement. | |
6185 * @param source the source to be parsed | |
6186 * @param errorCodes the error codes of the errors that are expected to be fou
nd | |
6187 * @return the statement that was parsed | |
6188 * @throws Exception if the source could not be parsed, if the compilation err
ors in the source do | |
6189 * not match those that are expected, or if the result would have been {@code
null} | |
6190 */ | |
6191 static Statement parseStatement(String source, List<ErrorCode> errorCodes) { | |
6192 GatheringErrorListener listener = new GatheringErrorListener(); | |
6193 StringScanner scanner = new StringScanner(null, source, listener); | |
6194 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
6195 Token token = scanner.tokenize(); | |
6196 Parser parser = new Parser(null, listener); | |
6197 Statement statement = parser.parseStatement(token); | |
6198 JUnitTestCase.assertNotNull(statement); | |
6199 listener.assertErrors2(errorCodes); | |
6200 return statement as Statement; | |
6201 } | |
6202 /** | |
6203 * Parse the given source as a sequence of statements. | |
6204 * @param source the source to be parsed | |
6205 * @param expectedCount the number of statements that are expected | |
6206 * @param errorCodes the error codes of the errors that are expected to be fou
nd | |
6207 * @return the statements that were parsed | |
6208 * @throws Exception if the source could not be parsed, if the number of state
ments does not match | |
6209 * the expected count, if the compilation errors in the source do not match th
ose that | |
6210 * are expected, or if the result would have been {@code null} | |
6211 */ | |
6212 static List<Statement> parseStatements(String source, int expectedCount, List<
ErrorCode> errorCodes) { | |
6213 GatheringErrorListener listener = new GatheringErrorListener(); | |
6214 StringScanner scanner = new StringScanner(null, source, listener); | |
6215 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
6216 Token token = scanner.tokenize(); | |
6217 Parser parser = new Parser(null, listener); | |
6218 List<Statement> statements = parser.parseStatements(token); | |
6219 EngineTestCase.assertSize(expectedCount, statements); | |
6220 listener.assertErrors2(errorCodes); | |
6221 return statements; | |
6222 } | |
6223 /** | |
6224 * Invoke a method in {@link Parser}. The method is assumed to have the given
number and type of | |
6225 * parameters and will be invoked with the given arguments. | |
6226 * <p> | |
6227 * The given source is scanned and the parser is initialized to start with the
first token in the | |
6228 * source before the method is invoked. | |
6229 * @param methodName the name of the method that should be invoked | |
6230 * @param objects the values of the arguments to the method | |
6231 * @param source the source to be processed by the parse method | |
6232 * @param listener the error listener that will be used for both scanning and
parsing | |
6233 * @return the result of invoking the method | |
6234 * @throws Exception if the method could not be invoked or throws an exception | |
6235 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
6236 * scanning and parsing the source do not match the expected errors | |
6237 */ | |
6238 static Object invokeParserMethod(String methodName, List<Object> objects, Stri
ng source, GatheringErrorListener listener) { | |
6239 StringScanner scanner = new StringScanner(null, source, listener); | |
6240 Token tokenStream = scanner.tokenize(); | |
6241 listener.setLineInfo(new TestSource(), scanner.lineStarts); | |
6242 Parser parser = new Parser(null, listener); | |
6243 Object result = invokeParserMethodImpl(parser, methodName, objects, tokenStr
eam); | |
6244 JUnitTestCase.assertNotNull(result); | |
6245 return result as Object; | |
6246 } | |
6247 /** | |
6248 * Invoke a method in {@link Parser}. The method is assumed to have no argumen
ts. | |
6249 * <p> | |
6250 * The given source is scanned and the parser is initialized to start with the
first token in the | |
6251 * source before the method is invoked. | |
6252 * @param methodName the name of the method that should be invoked | |
6253 * @param source the source to be processed by the parse method | |
6254 * @param listener the error listener that will be used for both scanning and
parsing | |
6255 * @return the result of invoking the method | |
6256 * @throws Exception if the method could not be invoked or throws an exception | |
6257 * @throws AssertionFailedError if the result is {@code null} or the errors pr
oduced while | |
6258 * scanning and parsing the source do not match the expected errors | |
6259 */ | |
6260 static Object invokeParserMethod2(String methodName, String source, GatheringE
rrorListener listener) => invokeParserMethod(methodName, _EMPTY_ARGUMENTS, sourc
e, listener); | |
6261 /** | |
6262 * Return a CommentAndMetadata object with the given values that can be used f
or testing. | |
6263 * @param comment the comment to be wrapped in the object | |
6264 * @param annotations the annotations to be wrapped in the object | |
6265 * @return a CommentAndMetadata object that can be used for testing | |
6266 */ | |
6267 CommentAndMetadata commentAndMetadata(Comment comment, List<Annotation> annota
tions) { | |
6268 List<Annotation> metadata = new List<Annotation>(); | |
6269 for (Annotation annotation in annotations) { | |
6270 metadata.add(annotation); | |
6271 } | |
6272 return new CommentAndMetadata(comment, metadata); | |
6273 } | |
6274 /** | |
6275 * Return an empty CommentAndMetadata object that can be used for testing. | |
6276 * @return an empty CommentAndMetadata object that can be used for testing | |
6277 */ | |
6278 CommentAndMetadata emptyCommentAndMetadata() => new CommentAndMetadata(null, n
ew List<Annotation>()); | |
6279 static dartSuite() { | |
6280 _ut.group('ParserTestCase', () { | |
6281 }); | |
6282 } | |
6283 } | |
6284 /** | |
6285 * The class {@code RecoveryParserTest} defines parser tests that test the parsi
ng of invalid code | |
6286 * sequences to ensure that the correct recovery steps are taken in the parser. | |
6287 */ | |
6288 class RecoveryParserTest extends ParserTestCase { | |
6289 void test_additiveExpression_missing_LHS() { | |
6290 BinaryExpression expression = ParserTestCase.parseExpression("+ y", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
6291 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6292 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6293 } | |
6294 void test_additiveExpression_missing_LHS_RHS() { | |
6295 BinaryExpression expression = ParserTestCase.parseExpression("+", [ParserErr
orCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
6296 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6297 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6298 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6299 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6300 } | |
6301 void test_additiveExpression_missing_RHS() { | |
6302 BinaryExpression expression = ParserTestCase.parseExpression("x +", []); | |
6303 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6304 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6305 } | |
6306 void test_additiveExpression_missing_RHS_super() { | |
6307 BinaryExpression expression = ParserTestCase.parseExpression("super +", []); | |
6308 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6309 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6310 } | |
6311 void test_additiveExpression_precedence_multiplicative_left() { | |
6312 BinaryExpression expression = ParserTestCase.parseExpression("* +", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
6313 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6314 } | |
6315 void test_additiveExpression_precedence_multiplicative_right() { | |
6316 BinaryExpression expression = ParserTestCase.parseExpression("+ *", [ParserE
rrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
6317 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
6318 } | |
6319 void test_additiveExpression_super() { | |
6320 BinaryExpression expression = ParserTestCase.parseExpression("super + +", [P
arserErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
6321 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6322 } | |
6323 void test_argumentDefinitionTest_missing_identifier() { | |
6324 ArgumentDefinitionTest expression = ParserTestCase.parseExpression("?", [Par
serErrorCode.MISSING_IDENTIFIER]); | |
6325 JUnitTestCase.assertTrue(expression.identifier.isSynthetic()); | |
6326 } | |
6327 void test_assignmentExpression_missing_compound1() { | |
6328 AssignmentExpression expression = ParserTestCase.parseExpression("= y = 0",
[]); | |
6329 Expression syntheticExpression = expression.leftHandSide; | |
6330 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
6331 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
6332 } | |
6333 void test_assignmentExpression_missing_compound2() { | |
6334 AssignmentExpression expression = ParserTestCase.parseExpression("x = = 0",
[]); | |
6335 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).leftHandSide; | |
6336 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
6337 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
6338 } | |
6339 void test_assignmentExpression_missing_compound3() { | |
6340 AssignmentExpression expression = ParserTestCase.parseExpression("x = y =",
[]); | |
6341 Expression syntheticExpression = ((expression.rightHandSide as AssignmentExp
ression)).rightHandSide; | |
6342 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
6343 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
6344 } | |
6345 void test_assignmentExpression_missing_LHS() { | |
6346 AssignmentExpression expression = ParserTestCase.parseExpression("= 0", []); | |
6347 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); | |
6348 JUnitTestCase.assertTrue(expression.leftHandSide.isSynthetic()); | |
6349 } | |
6350 void test_assignmentExpression_missing_RHS() { | |
6351 AssignmentExpression expression = ParserTestCase.parseExpression("x =", []); | |
6352 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftHandSide); | |
6353 JUnitTestCase.assertTrue(expression.rightHandSide.isSynthetic()); | |
6354 } | |
6355 void test_bitwiseAndExpression_missing_LHS() { | |
6356 BinaryExpression expression = ParserTestCase.parseExpression("& y", []); | |
6357 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6358 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6359 } | |
6360 void test_bitwiseAndExpression_missing_LHS_RHS() { | |
6361 BinaryExpression expression = ParserTestCase.parseExpression("&", []); | |
6362 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6363 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6364 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6365 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6366 } | |
6367 void test_bitwiseAndExpression_missing_RHS() { | |
6368 BinaryExpression expression = ParserTestCase.parseExpression("x &", []); | |
6369 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6370 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6371 } | |
6372 void test_bitwiseAndExpression_missing_RHS_super() { | |
6373 BinaryExpression expression = ParserTestCase.parseExpression("super &", []); | |
6374 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6375 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6376 } | |
6377 void test_bitwiseAndExpression_precedence_equality_left() { | |
6378 BinaryExpression expression = ParserTestCase.parseExpression("== &", []); | |
6379 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6380 } | |
6381 void test_bitwiseAndExpression_precedence_equality_right() { | |
6382 BinaryExpression expression = ParserTestCase.parseExpression("& ==", []); | |
6383 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
6384 } | |
6385 void test_bitwiseAndExpression_super() { | |
6386 BinaryExpression expression = ParserTestCase.parseExpression("super & &", [
]); | |
6387 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6388 } | |
6389 void test_bitwiseOrExpression_missing_LHS() { | |
6390 BinaryExpression expression = ParserTestCase.parseExpression("| y", []); | |
6391 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6392 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6393 } | |
6394 void test_bitwiseOrExpression_missing_LHS_RHS() { | |
6395 BinaryExpression expression = ParserTestCase.parseExpression("|", []); | |
6396 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6397 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6398 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6399 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6400 } | |
6401 void test_bitwiseOrExpression_missing_RHS() { | |
6402 BinaryExpression expression = ParserTestCase.parseExpression("x |", []); | |
6403 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6404 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6405 } | |
6406 void test_bitwiseOrExpression_missing_RHS_super() { | |
6407 BinaryExpression expression = ParserTestCase.parseExpression("super |", []); | |
6408 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6409 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6410 } | |
6411 void test_bitwiseOrExpression_precedence_xor_left() { | |
6412 BinaryExpression expression = ParserTestCase.parseExpression("^ |", []); | |
6413 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6414 } | |
6415 void test_bitwiseOrExpression_precedence_xor_right() { | |
6416 BinaryExpression expression = ParserTestCase.parseExpression("| ^", []); | |
6417 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
6418 } | |
6419 void test_bitwiseOrExpression_super() { | |
6420 BinaryExpression expression = ParserTestCase.parseExpression("super | |", [
]); | |
6421 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6422 } | |
6423 void test_bitwiseXorExpression_missing_LHS() { | |
6424 BinaryExpression expression = ParserTestCase.parseExpression("^ y", []); | |
6425 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6426 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6427 } | |
6428 void test_bitwiseXorExpression_missing_LHS_RHS() { | |
6429 BinaryExpression expression = ParserTestCase.parseExpression("^", []); | |
6430 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6431 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6432 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6433 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6434 } | |
6435 void test_bitwiseXorExpression_missing_RHS() { | |
6436 BinaryExpression expression = ParserTestCase.parseExpression("x ^", []); | |
6437 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6438 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6439 } | |
6440 void test_bitwiseXorExpression_missing_RHS_super() { | |
6441 BinaryExpression expression = ParserTestCase.parseExpression("super ^", []); | |
6442 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6443 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6444 } | |
6445 void test_bitwiseXorExpression_precedence_and_left() { | |
6446 BinaryExpression expression = ParserTestCase.parseExpression("& ^", []); | |
6447 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6448 } | |
6449 void test_bitwiseXorExpression_precedence_and_right() { | |
6450 BinaryExpression expression = ParserTestCase.parseExpression("^ &", []); | |
6451 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
6452 } | |
6453 void test_bitwiseXorExpression_super() { | |
6454 BinaryExpression expression = ParserTestCase.parseExpression("super ^ ^", [
]); | |
6455 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6456 } | |
6457 void test_conditionalExpression_missingElse() { | |
6458 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx
pression", "x ? y :", []); | |
6459 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.elseExpression)
; | |
6460 JUnitTestCase.assertTrue(expression.elseExpression.isSynthetic()); | |
6461 } | |
6462 void test_conditionalExpression_missingThen() { | |
6463 ConditionalExpression expression = ParserTestCase.parse6("parseConditionalEx
pression", "x ? : z", []); | |
6464 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.thenExpression)
; | |
6465 JUnitTestCase.assertTrue(expression.thenExpression.isSynthetic()); | |
6466 } | |
6467 void test_equalityExpression_missing_LHS() { | |
6468 BinaryExpression expression = ParserTestCase.parseExpression("== y", []); | |
6469 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6470 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6471 } | |
6472 void test_equalityExpression_missing_LHS_RHS() { | |
6473 BinaryExpression expression = ParserTestCase.parseExpression("==", []); | |
6474 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6475 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6476 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6477 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6478 } | |
6479 void test_equalityExpression_missing_RHS() { | |
6480 BinaryExpression expression = ParserTestCase.parseExpression("x ==", []); | |
6481 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6482 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6483 } | |
6484 void test_equalityExpression_missing_RHS_super() { | |
6485 BinaryExpression expression = ParserTestCase.parseExpression("super ==", [])
; | |
6486 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6487 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6488 } | |
6489 void test_equalityExpression_precedence_relational_left() { | |
6490 BinaryExpression expression = ParserTestCase.parseExpression("is ==", [Parse
rErrorCode.MISSING_IDENTIFIER]); | |
6491 EngineTestCase.assertInstanceOf(IsExpression, expression.leftOperand); | |
6492 } | |
6493 void test_equalityExpression_precedence_relational_right() { | |
6494 BinaryExpression expression = ParserTestCase.parseExpression("== is", [Parse
rErrorCode.MISSING_IDENTIFIER]); | |
6495 EngineTestCase.assertInstanceOf(IsExpression, expression.rightOperand); | |
6496 } | |
6497 void test_equalityExpression_super() { | |
6498 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[]); | |
6499 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6500 } | |
6501 void test_expressionList_multiple_end() { | |
6502 List<Expression> result = ParserTestCase.parse6("parseExpressionList", ", 2,
3, 4", []); | |
6503 EngineTestCase.assertSize(4, result); | |
6504 Expression syntheticExpression = result[0]; | |
6505 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
6506 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
6507 } | |
6508 void test_expressionList_multiple_middle() { | |
6509 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2
, , 4", []); | |
6510 EngineTestCase.assertSize(4, result); | |
6511 Expression syntheticExpression = result[2]; | |
6512 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
6513 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
6514 } | |
6515 void test_expressionList_multiple_start() { | |
6516 List<Expression> result = ParserTestCase.parse6("parseExpressionList", "1, 2
, 3,", []); | |
6517 EngineTestCase.assertSize(4, result); | |
6518 Expression syntheticExpression = result[3]; | |
6519 EngineTestCase.assertInstanceOf(SimpleIdentifier, syntheticExpression); | |
6520 JUnitTestCase.assertTrue(syntheticExpression.isSynthetic()); | |
6521 } | |
6522 void test_logicalAndExpression_missing_LHS() { | |
6523 BinaryExpression expression = ParserTestCase.parseExpression("&& y", []); | |
6524 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6525 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6526 } | |
6527 void test_logicalAndExpression_missing_LHS_RHS() { | |
6528 BinaryExpression expression = ParserTestCase.parseExpression("&&", []); | |
6529 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6530 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6531 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6532 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6533 } | |
6534 void test_logicalAndExpression_missing_RHS() { | |
6535 BinaryExpression expression = ParserTestCase.parseExpression("x &&", []); | |
6536 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6537 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6538 } | |
6539 void test_logicalAndExpression_precedence_bitwiseOr_left() { | |
6540 BinaryExpression expression = ParserTestCase.parseExpression("| &&", []); | |
6541 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6542 } | |
6543 void test_logicalAndExpression_precedence_bitwiseOr_right() { | |
6544 BinaryExpression expression = ParserTestCase.parseExpression("&& |", []); | |
6545 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
6546 } | |
6547 void test_logicalOrExpression_missing_LHS() { | |
6548 BinaryExpression expression = ParserTestCase.parseExpression("|| y", []); | |
6549 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6550 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6551 } | |
6552 void test_logicalOrExpression_missing_LHS_RHS() { | |
6553 BinaryExpression expression = ParserTestCase.parseExpression("||", []); | |
6554 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6555 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6556 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6557 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6558 } | |
6559 void test_logicalOrExpression_missing_RHS() { | |
6560 BinaryExpression expression = ParserTestCase.parseExpression("x ||", []); | |
6561 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6562 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6563 } | |
6564 void test_logicalOrExpression_precedence_logicalAnd_left() { | |
6565 BinaryExpression expression = ParserTestCase.parseExpression("&& ||", []); | |
6566 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6567 } | |
6568 void test_logicalOrExpression_precedence_logicalAnd_right() { | |
6569 BinaryExpression expression = ParserTestCase.parseExpression("|| &&", []); | |
6570 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
6571 } | |
6572 void test_multiplicativeExpression_missing_LHS() { | |
6573 BinaryExpression expression = ParserTestCase.parseExpression("* y", []); | |
6574 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6575 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6576 } | |
6577 void test_multiplicativeExpression_missing_LHS_RHS() { | |
6578 BinaryExpression expression = ParserTestCase.parseExpression("*", []); | |
6579 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6580 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6581 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6582 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6583 } | |
6584 void test_multiplicativeExpression_missing_RHS() { | |
6585 BinaryExpression expression = ParserTestCase.parseExpression("x *", []); | |
6586 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6587 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6588 } | |
6589 void test_multiplicativeExpression_missing_RHS_super() { | |
6590 BinaryExpression expression = ParserTestCase.parseExpression("super *", []); | |
6591 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6592 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6593 } | |
6594 void test_multiplicativeExpression_precedence_unary_left() { | |
6595 BinaryExpression expression = ParserTestCase.parseExpression("-x *", []); | |
6596 EngineTestCase.assertInstanceOf(PrefixExpression, expression.leftOperand); | |
6597 } | |
6598 void test_multiplicativeExpression_precedence_unary_right() { | |
6599 BinaryExpression expression = ParserTestCase.parseExpression("* -y", []); | |
6600 EngineTestCase.assertInstanceOf(PrefixExpression, expression.rightOperand); | |
6601 } | |
6602 void test_multiplicativeExpression_super() { | |
6603 BinaryExpression expression = ParserTestCase.parseExpression("super == ==",
[]); | |
6604 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6605 } | |
6606 void test_prefixExpression_missing_operand_minus() { | |
6607 PrefixExpression expression = ParserTestCase.parseExpression("-", []); | |
6608 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.operand); | |
6609 JUnitTestCase.assertTrue(expression.operand.isSynthetic()); | |
6610 JUnitTestCase.assertEquals(TokenType.MINUS, expression.operator.type); | |
6611 } | |
6612 void test_relationalExpression_missing_LHS() { | |
6613 IsExpression expression = ParserTestCase.parseExpression("is y", []); | |
6614 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); | |
6615 JUnitTestCase.assertTrue(expression.expression.isSynthetic()); | |
6616 } | |
6617 void test_relationalExpression_missing_LHS_RHS() { | |
6618 IsExpression expression = ParserTestCase.parseExpression("is", [ParserErrorC
ode.MISSING_IDENTIFIER]); | |
6619 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.expression); | |
6620 JUnitTestCase.assertTrue(expression.expression.isSynthetic()); | |
6621 EngineTestCase.assertInstanceOf(TypeName, expression.type); | |
6622 JUnitTestCase.assertTrue(expression.type.isSynthetic()); | |
6623 } | |
6624 void test_relationalExpression_missing_RHS() { | |
6625 IsExpression expression = ParserTestCase.parseExpression("x is", [ParserErro
rCode.MISSING_IDENTIFIER]); | |
6626 EngineTestCase.assertInstanceOf(TypeName, expression.type); | |
6627 JUnitTestCase.assertTrue(expression.type.isSynthetic()); | |
6628 } | |
6629 void test_relationalExpression_precedence_shift_right() { | |
6630 IsExpression expression = ParserTestCase.parseExpression("<< is", [ParserErr
orCode.MISSING_IDENTIFIER]); | |
6631 EngineTestCase.assertInstanceOf(BinaryExpression, expression.expression); | |
6632 } | |
6633 void test_shiftExpression_missing_LHS() { | |
6634 BinaryExpression expression = ParserTestCase.parseExpression("<< y", []); | |
6635 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6636 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6637 } | |
6638 void test_shiftExpression_missing_LHS_RHS() { | |
6639 BinaryExpression expression = ParserTestCase.parseExpression("<<", []); | |
6640 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.leftOperand); | |
6641 JUnitTestCase.assertTrue(expression.leftOperand.isSynthetic()); | |
6642 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6643 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6644 } | |
6645 void test_shiftExpression_missing_RHS() { | |
6646 BinaryExpression expression = ParserTestCase.parseExpression("x <<", []); | |
6647 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6648 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6649 } | |
6650 void test_shiftExpression_missing_RHS_super() { | |
6651 BinaryExpression expression = ParserTestCase.parseExpression("super <<", [])
; | |
6652 EngineTestCase.assertInstanceOf(SimpleIdentifier, expression.rightOperand); | |
6653 JUnitTestCase.assertTrue(expression.rightOperand.isSynthetic()); | |
6654 } | |
6655 void test_shiftExpression_precedence_unary_left() { | |
6656 BinaryExpression expression = ParserTestCase.parseExpression("+ <<", [Parser
ErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
6657 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6658 } | |
6659 void test_shiftExpression_precedence_unary_right() { | |
6660 BinaryExpression expression = ParserTestCase.parseExpression("<< +", [Parser
ErrorCode.USE_OF_UNARY_PLUS_OPERATOR]); | |
6661 EngineTestCase.assertInstanceOf(BinaryExpression, expression.rightOperand); | |
6662 } | |
6663 void test_shiftExpression_super() { | |
6664 BinaryExpression expression = ParserTestCase.parseExpression("super << <<",
[]); | |
6665 EngineTestCase.assertInstanceOf(BinaryExpression, expression.leftOperand); | |
6666 } | |
6667 void test_typedef_eof() { | |
6668 CompilationUnit unit = ParserTestCase.parseCompilationUnit("typedef n", [Par
serErrorCode.EXPECTED_TOKEN, ParserErrorCode.MISSING_TYPEDEF_PARAMETERS]); | |
6669 NodeList<CompilationUnitMember> declarations3 = unit.declarations; | |
6670 EngineTestCase.assertSize(1, declarations3); | |
6671 CompilationUnitMember member = declarations3[0]; | |
6672 EngineTestCase.assertInstanceOf(FunctionTypeAlias, member); | |
6673 } | |
6674 static dartSuite() { | |
6675 _ut.group('RecoveryParserTest', () { | |
6676 _ut.test('test_additiveExpression_missing_LHS', () { | |
6677 final __test = new RecoveryParserTest(); | |
6678 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS); | |
6679 }); | |
6680 _ut.test('test_additiveExpression_missing_LHS_RHS', () { | |
6681 final __test = new RecoveryParserTest(); | |
6682 runJUnitTest(__test, __test.test_additiveExpression_missing_LHS_RHS); | |
6683 }); | |
6684 _ut.test('test_additiveExpression_missing_RHS', () { | |
6685 final __test = new RecoveryParserTest(); | |
6686 runJUnitTest(__test, __test.test_additiveExpression_missing_RHS); | |
6687 }); | |
6688 _ut.test('test_additiveExpression_missing_RHS_super', () { | |
6689 final __test = new RecoveryParserTest(); | |
6690 runJUnitTest(__test, __test.test_additiveExpression_missing_RHS_super); | |
6691 }); | |
6692 _ut.test('test_additiveExpression_precedence_multiplicative_left', () { | |
6693 final __test = new RecoveryParserTest(); | |
6694 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_left); | |
6695 }); | |
6696 _ut.test('test_additiveExpression_precedence_multiplicative_right', () { | |
6697 final __test = new RecoveryParserTest(); | |
6698 runJUnitTest(__test, __test.test_additiveExpression_precedence_multiplic
ative_right); | |
6699 }); | |
6700 _ut.test('test_additiveExpression_super', () { | |
6701 final __test = new RecoveryParserTest(); | |
6702 runJUnitTest(__test, __test.test_additiveExpression_super); | |
6703 }); | |
6704 _ut.test('test_argumentDefinitionTest_missing_identifier', () { | |
6705 final __test = new RecoveryParserTest(); | |
6706 runJUnitTest(__test, __test.test_argumentDefinitionTest_missing_identifi
er); | |
6707 }); | |
6708 _ut.test('test_assignmentExpression_missing_LHS', () { | |
6709 final __test = new RecoveryParserTest(); | |
6710 runJUnitTest(__test, __test.test_assignmentExpression_missing_LHS); | |
6711 }); | |
6712 _ut.test('test_assignmentExpression_missing_RHS', () { | |
6713 final __test = new RecoveryParserTest(); | |
6714 runJUnitTest(__test, __test.test_assignmentExpression_missing_RHS); | |
6715 }); | |
6716 _ut.test('test_assignmentExpression_missing_compound1', () { | |
6717 final __test = new RecoveryParserTest(); | |
6718 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound1)
; | |
6719 }); | |
6720 _ut.test('test_assignmentExpression_missing_compound2', () { | |
6721 final __test = new RecoveryParserTest(); | |
6722 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound2)
; | |
6723 }); | |
6724 _ut.test('test_assignmentExpression_missing_compound3', () { | |
6725 final __test = new RecoveryParserTest(); | |
6726 runJUnitTest(__test, __test.test_assignmentExpression_missing_compound3)
; | |
6727 }); | |
6728 _ut.test('test_bitwiseAndExpression_missing_LHS', () { | |
6729 final __test = new RecoveryParserTest(); | |
6730 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_LHS); | |
6731 }); | |
6732 _ut.test('test_bitwiseAndExpression_missing_LHS_RHS', () { | |
6733 final __test = new RecoveryParserTest(); | |
6734 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_LHS_RHS); | |
6735 }); | |
6736 _ut.test('test_bitwiseAndExpression_missing_RHS', () { | |
6737 final __test = new RecoveryParserTest(); | |
6738 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_RHS); | |
6739 }); | |
6740 _ut.test('test_bitwiseAndExpression_missing_RHS_super', () { | |
6741 final __test = new RecoveryParserTest(); | |
6742 runJUnitTest(__test, __test.test_bitwiseAndExpression_missing_RHS_super)
; | |
6743 }); | |
6744 _ut.test('test_bitwiseAndExpression_precedence_equality_left', () { | |
6745 final __test = new RecoveryParserTest(); | |
6746 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit
y_left); | |
6747 }); | |
6748 _ut.test('test_bitwiseAndExpression_precedence_equality_right', () { | |
6749 final __test = new RecoveryParserTest(); | |
6750 runJUnitTest(__test, __test.test_bitwiseAndExpression_precedence_equalit
y_right); | |
6751 }); | |
6752 _ut.test('test_bitwiseAndExpression_super', () { | |
6753 final __test = new RecoveryParserTest(); | |
6754 runJUnitTest(__test, __test.test_bitwiseAndExpression_super); | |
6755 }); | |
6756 _ut.test('test_bitwiseOrExpression_missing_LHS', () { | |
6757 final __test = new RecoveryParserTest(); | |
6758 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_LHS); | |
6759 }); | |
6760 _ut.test('test_bitwiseOrExpression_missing_LHS_RHS', () { | |
6761 final __test = new RecoveryParserTest(); | |
6762 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_LHS_RHS); | |
6763 }); | |
6764 _ut.test('test_bitwiseOrExpression_missing_RHS', () { | |
6765 final __test = new RecoveryParserTest(); | |
6766 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_RHS); | |
6767 }); | |
6768 _ut.test('test_bitwiseOrExpression_missing_RHS_super', () { | |
6769 final __test = new RecoveryParserTest(); | |
6770 runJUnitTest(__test, __test.test_bitwiseOrExpression_missing_RHS_super); | |
6771 }); | |
6772 _ut.test('test_bitwiseOrExpression_precedence_xor_left', () { | |
6773 final __test = new RecoveryParserTest(); | |
6774 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_left
); | |
6775 }); | |
6776 _ut.test('test_bitwiseOrExpression_precedence_xor_right', () { | |
6777 final __test = new RecoveryParserTest(); | |
6778 runJUnitTest(__test, __test.test_bitwiseOrExpression_precedence_xor_righ
t); | |
6779 }); | |
6780 _ut.test('test_bitwiseOrExpression_super', () { | |
6781 final __test = new RecoveryParserTest(); | |
6782 runJUnitTest(__test, __test.test_bitwiseOrExpression_super); | |
6783 }); | |
6784 _ut.test('test_bitwiseXorExpression_missing_LHS', () { | |
6785 final __test = new RecoveryParserTest(); | |
6786 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_LHS); | |
6787 }); | |
6788 _ut.test('test_bitwiseXorExpression_missing_LHS_RHS', () { | |
6789 final __test = new RecoveryParserTest(); | |
6790 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_LHS_RHS); | |
6791 }); | |
6792 _ut.test('test_bitwiseXorExpression_missing_RHS', () { | |
6793 final __test = new RecoveryParserTest(); | |
6794 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_RHS); | |
6795 }); | |
6796 _ut.test('test_bitwiseXorExpression_missing_RHS_super', () { | |
6797 final __test = new RecoveryParserTest(); | |
6798 runJUnitTest(__test, __test.test_bitwiseXorExpression_missing_RHS_super)
; | |
6799 }); | |
6800 _ut.test('test_bitwiseXorExpression_precedence_and_left', () { | |
6801 final __test = new RecoveryParserTest(); | |
6802 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_lef
t); | |
6803 }); | |
6804 _ut.test('test_bitwiseXorExpression_precedence_and_right', () { | |
6805 final __test = new RecoveryParserTest(); | |
6806 runJUnitTest(__test, __test.test_bitwiseXorExpression_precedence_and_rig
ht); | |
6807 }); | |
6808 _ut.test('test_bitwiseXorExpression_super', () { | |
6809 final __test = new RecoveryParserTest(); | |
6810 runJUnitTest(__test, __test.test_bitwiseXorExpression_super); | |
6811 }); | |
6812 _ut.test('test_conditionalExpression_missingElse', () { | |
6813 final __test = new RecoveryParserTest(); | |
6814 runJUnitTest(__test, __test.test_conditionalExpression_missingElse); | |
6815 }); | |
6816 _ut.test('test_conditionalExpression_missingThen', () { | |
6817 final __test = new RecoveryParserTest(); | |
6818 runJUnitTest(__test, __test.test_conditionalExpression_missingThen); | |
6819 }); | |
6820 _ut.test('test_equalityExpression_missing_LHS', () { | |
6821 final __test = new RecoveryParserTest(); | |
6822 runJUnitTest(__test, __test.test_equalityExpression_missing_LHS); | |
6823 }); | |
6824 _ut.test('test_equalityExpression_missing_LHS_RHS', () { | |
6825 final __test = new RecoveryParserTest(); | |
6826 runJUnitTest(__test, __test.test_equalityExpression_missing_LHS_RHS); | |
6827 }); | |
6828 _ut.test('test_equalityExpression_missing_RHS', () { | |
6829 final __test = new RecoveryParserTest(); | |
6830 runJUnitTest(__test, __test.test_equalityExpression_missing_RHS); | |
6831 }); | |
6832 _ut.test('test_equalityExpression_missing_RHS_super', () { | |
6833 final __test = new RecoveryParserTest(); | |
6834 runJUnitTest(__test, __test.test_equalityExpression_missing_RHS_super); | |
6835 }); | |
6836 _ut.test('test_equalityExpression_precedence_relational_left', () { | |
6837 final __test = new RecoveryParserTest(); | |
6838 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa
l_left); | |
6839 }); | |
6840 _ut.test('test_equalityExpression_precedence_relational_right', () { | |
6841 final __test = new RecoveryParserTest(); | |
6842 runJUnitTest(__test, __test.test_equalityExpression_precedence_relationa
l_right); | |
6843 }); | |
6844 _ut.test('test_equalityExpression_super', () { | |
6845 final __test = new RecoveryParserTest(); | |
6846 runJUnitTest(__test, __test.test_equalityExpression_super); | |
6847 }); | |
6848 _ut.test('test_expressionList_multiple_end', () { | |
6849 final __test = new RecoveryParserTest(); | |
6850 runJUnitTest(__test, __test.test_expressionList_multiple_end); | |
6851 }); | |
6852 _ut.test('test_expressionList_multiple_middle', () { | |
6853 final __test = new RecoveryParserTest(); | |
6854 runJUnitTest(__test, __test.test_expressionList_multiple_middle); | |
6855 }); | |
6856 _ut.test('test_expressionList_multiple_start', () { | |
6857 final __test = new RecoveryParserTest(); | |
6858 runJUnitTest(__test, __test.test_expressionList_multiple_start); | |
6859 }); | |
6860 _ut.test('test_logicalAndExpression_missing_LHS', () { | |
6861 final __test = new RecoveryParserTest(); | |
6862 runJUnitTest(__test, __test.test_logicalAndExpression_missing_LHS); | |
6863 }); | |
6864 _ut.test('test_logicalAndExpression_missing_LHS_RHS', () { | |
6865 final __test = new RecoveryParserTest(); | |
6866 runJUnitTest(__test, __test.test_logicalAndExpression_missing_LHS_RHS); | |
6867 }); | |
6868 _ut.test('test_logicalAndExpression_missing_RHS', () { | |
6869 final __test = new RecoveryParserTest(); | |
6870 runJUnitTest(__test, __test.test_logicalAndExpression_missing_RHS); | |
6871 }); | |
6872 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_left', () { | |
6873 final __test = new RecoveryParserTest(); | |
6874 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise
Or_left); | |
6875 }); | |
6876 _ut.test('test_logicalAndExpression_precedence_bitwiseOr_right', () { | |
6877 final __test = new RecoveryParserTest(); | |
6878 runJUnitTest(__test, __test.test_logicalAndExpression_precedence_bitwise
Or_right); | |
6879 }); | |
6880 _ut.test('test_logicalOrExpression_missing_LHS', () { | |
6881 final __test = new RecoveryParserTest(); | |
6882 runJUnitTest(__test, __test.test_logicalOrExpression_missing_LHS); | |
6883 }); | |
6884 _ut.test('test_logicalOrExpression_missing_LHS_RHS', () { | |
6885 final __test = new RecoveryParserTest(); | |
6886 runJUnitTest(__test, __test.test_logicalOrExpression_missing_LHS_RHS); | |
6887 }); | |
6888 _ut.test('test_logicalOrExpression_missing_RHS', () { | |
6889 final __test = new RecoveryParserTest(); | |
6890 runJUnitTest(__test, __test.test_logicalOrExpression_missing_RHS); | |
6891 }); | |
6892 _ut.test('test_logicalOrExpression_precedence_logicalAnd_left', () { | |
6893 final __test = new RecoveryParserTest(); | |
6894 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA
nd_left); | |
6895 }); | |
6896 _ut.test('test_logicalOrExpression_precedence_logicalAnd_right', () { | |
6897 final __test = new RecoveryParserTest(); | |
6898 runJUnitTest(__test, __test.test_logicalOrExpression_precedence_logicalA
nd_right); | |
6899 }); | |
6900 _ut.test('test_multiplicativeExpression_missing_LHS', () { | |
6901 final __test = new RecoveryParserTest(); | |
6902 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS); | |
6903 }); | |
6904 _ut.test('test_multiplicativeExpression_missing_LHS_RHS', () { | |
6905 final __test = new RecoveryParserTest(); | |
6906 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_LHS_RH
S); | |
6907 }); | |
6908 _ut.test('test_multiplicativeExpression_missing_RHS', () { | |
6909 final __test = new RecoveryParserTest(); | |
6910 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_RHS); | |
6911 }); | |
6912 _ut.test('test_multiplicativeExpression_missing_RHS_super', () { | |
6913 final __test = new RecoveryParserTest(); | |
6914 runJUnitTest(__test, __test.test_multiplicativeExpression_missing_RHS_su
per); | |
6915 }); | |
6916 _ut.test('test_multiplicativeExpression_precedence_unary_left', () { | |
6917 final __test = new RecoveryParserTest(); | |
6918 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una
ry_left); | |
6919 }); | |
6920 _ut.test('test_multiplicativeExpression_precedence_unary_right', () { | |
6921 final __test = new RecoveryParserTest(); | |
6922 runJUnitTest(__test, __test.test_multiplicativeExpression_precedence_una
ry_right); | |
6923 }); | |
6924 _ut.test('test_multiplicativeExpression_super', () { | |
6925 final __test = new RecoveryParserTest(); | |
6926 runJUnitTest(__test, __test.test_multiplicativeExpression_super); | |
6927 }); | |
6928 _ut.test('test_prefixExpression_missing_operand_minus', () { | |
6929 final __test = new RecoveryParserTest(); | |
6930 runJUnitTest(__test, __test.test_prefixExpression_missing_operand_minus)
; | |
6931 }); | |
6932 _ut.test('test_relationalExpression_missing_LHS', () { | |
6933 final __test = new RecoveryParserTest(); | |
6934 runJUnitTest(__test, __test.test_relationalExpression_missing_LHS); | |
6935 }); | |
6936 _ut.test('test_relationalExpression_missing_LHS_RHS', () { | |
6937 final __test = new RecoveryParserTest(); | |
6938 runJUnitTest(__test, __test.test_relationalExpression_missing_LHS_RHS); | |
6939 }); | |
6940 _ut.test('test_relationalExpression_missing_RHS', () { | |
6941 final __test = new RecoveryParserTest(); | |
6942 runJUnitTest(__test, __test.test_relationalExpression_missing_RHS); | |
6943 }); | |
6944 _ut.test('test_relationalExpression_precedence_shift_right', () { | |
6945 final __test = new RecoveryParserTest(); | |
6946 runJUnitTest(__test, __test.test_relationalExpression_precedence_shift_r
ight); | |
6947 }); | |
6948 _ut.test('test_shiftExpression_missing_LHS', () { | |
6949 final __test = new RecoveryParserTest(); | |
6950 runJUnitTest(__test, __test.test_shiftExpression_missing_LHS); | |
6951 }); | |
6952 _ut.test('test_shiftExpression_missing_LHS_RHS', () { | |
6953 final __test = new RecoveryParserTest(); | |
6954 runJUnitTest(__test, __test.test_shiftExpression_missing_LHS_RHS); | |
6955 }); | |
6956 _ut.test('test_shiftExpression_missing_RHS', () { | |
6957 final __test = new RecoveryParserTest(); | |
6958 runJUnitTest(__test, __test.test_shiftExpression_missing_RHS); | |
6959 }); | |
6960 _ut.test('test_shiftExpression_missing_RHS_super', () { | |
6961 final __test = new RecoveryParserTest(); | |
6962 runJUnitTest(__test, __test.test_shiftExpression_missing_RHS_super); | |
6963 }); | |
6964 _ut.test('test_shiftExpression_precedence_unary_left', () { | |
6965 final __test = new RecoveryParserTest(); | |
6966 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_left); | |
6967 }); | |
6968 _ut.test('test_shiftExpression_precedence_unary_right', () { | |
6969 final __test = new RecoveryParserTest(); | |
6970 runJUnitTest(__test, __test.test_shiftExpression_precedence_unary_right)
; | |
6971 }); | |
6972 _ut.test('test_shiftExpression_super', () { | |
6973 final __test = new RecoveryParserTest(); | |
6974 runJUnitTest(__test, __test.test_shiftExpression_super); | |
6975 }); | |
6976 _ut.test('test_typedef_eof', () { | |
6977 final __test = new RecoveryParserTest(); | |
6978 runJUnitTest(__test, __test.test_typedef_eof); | |
6979 }); | |
6980 }); | |
6981 } | |
6982 } | |
6983 /** | |
6984 * The class {@code ErrorParserTest} defines parser tests that test the parsing
of code to ensure | |
6985 * that errors are correctly reported, and in some cases, not reported. | |
6986 */ | |
6987 class ErrorParserTest extends ParserTestCase { | |
6988 void fail_expectedListOrMapLiteral() { | |
6989 TypedLiteral literal = ParserTestCase.parse5("parseListOrMapLiteral", <Objec
t> [null], "1", [ParserErrorCode.EXPECTED_LIST_OR_MAP_LITERAL]); | |
6990 JUnitTestCase.assertTrue(literal.isSynthetic()); | |
6991 } | |
6992 void fail_illegalAssignmentToNonAssignable_superAssigned() { | |
6993 ParserTestCase.parse6("parseExpression", "super = x;", [ParserErrorCode.ILLE
GAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); | |
6994 } | |
6995 void fail_invalidCommentReference__new_nonIdentifier() { | |
6996 ParserTestCase.parse5("parseCommentReference", <Object> ["new 42", 0], "", [
ParserErrorCode.INVALID_COMMENT_REFERENCE]); | |
6997 } | |
6998 void fail_invalidCommentReference__new_tooMuch() { | |
6999 ParserTestCase.parse5("parseCommentReference", <Object> ["new a.b.c.d", 0],
"", [ParserErrorCode.INVALID_COMMENT_REFERENCE]); | |
7000 } | |
7001 void fail_invalidCommentReference__nonNew_nonIdentifier() { | |
7002 ParserTestCase.parse5("parseCommentReference", <Object> ["42", 0], "", [Pars
erErrorCode.INVALID_COMMENT_REFERENCE]); | |
7003 } | |
7004 void fail_invalidCommentReference__nonNew_tooMuch() { | |
7005 ParserTestCase.parse5("parseCommentReference", <Object> ["a.b.c.d", 0], "",
[ParserErrorCode.INVALID_COMMENT_REFERENCE]); | |
7006 } | |
7007 void fail_missingFunctionParameters_local_nonVoid_block() { | |
7008 ParserTestCase.parse6("parseStatement", "int f { return x;}", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); | |
7009 } | |
7010 void fail_missingFunctionParameters_local_nonVoid_expression() { | |
7011 ParserTestCase.parse6("parseStatement", "int f => x;", [ParserErrorCode.MISS
ING_FUNCTION_PARAMETERS]); | |
7012 } | |
7013 void fail_unexpectedToken_invalidPostfixExpression() { | |
7014 ParserTestCase.parse6("parseExpression", "f()++", [ParserErrorCode.UNEXPECTE
D_TOKEN]); | |
7015 } | |
7016 void fail_voidVariable_initializer() { | |
7017 ParserTestCase.parse6("parseStatement", "void x = 0;", [ParserErrorCode.VOID
_VARIABLE]); | |
7018 } | |
7019 void fail_voidVariable_noInitializer() { | |
7020 ParserTestCase.parse6("parseStatement", "void x;", [ParserErrorCode.VOID_VAR
IABLE]); | |
7021 } | |
7022 void test_abstractClassMember_constructor() { | |
7023 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract C.c();",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | |
7024 } | |
7025 void test_abstractClassMember_field() { | |
7026 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract C f;", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | |
7027 } | |
7028 void test_abstractClassMember_getter() { | |
7029 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract get m;",
[ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | |
7030 } | |
7031 void test_abstractClassMember_method() { | |
7032 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract m();", [
ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | |
7033 } | |
7034 void test_abstractClassMember_setter() { | |
7035 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "abstract set m(v)
;", [ParserErrorCode.ABSTRACT_CLASS_MEMBER]); | |
7036 } | |
7037 void test_abstractTopLevelFunction_function() { | |
7038 ParserTestCase.parse6("parseCompilationUnit", "abstract f(v) {}", [ParserErr
orCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | |
7039 } | |
7040 void test_abstractTopLevelFunction_getter() { | |
7041 ParserTestCase.parse6("parseCompilationUnit", "abstract get m {}", [ParserEr
rorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | |
7042 } | |
7043 void test_abstractTopLevelFunction_setter() { | |
7044 ParserTestCase.parse6("parseCompilationUnit", "abstract set m(v) {}", [Parse
rErrorCode.ABSTRACT_TOP_LEVEL_FUNCTION]); | |
7045 } | |
7046 void test_abstractTopLevelVariable() { | |
7047 ParserTestCase.parse6("parseCompilationUnit", "abstract C f;", [ParserErrorC
ode.ABSTRACT_TOP_LEVEL_VARIABLE]); | |
7048 } | |
7049 void test_abstractTypeDef() { | |
7050 ParserTestCase.parse6("parseCompilationUnit", "abstract typedef F();", [Pars
erErrorCode.ABSTRACT_TYPEDEF]); | |
7051 } | |
7052 void test_breakOutsideOfLoop_breakInDoStatement() { | |
7053 ParserTestCase.parse6("parseDoStatement", "do {break;} while (x);", []); | |
7054 } | |
7055 void test_breakOutsideOfLoop_breakInForStatement() { | |
7056 ParserTestCase.parse6("parseForStatement", "for (; x;) {break;}", []); | |
7057 } | |
7058 void test_breakOutsideOfLoop_breakInIfStatement() { | |
7059 ParserTestCase.parse6("parseIfStatement", "if (x) {break;}", [ParserErrorCod
e.BREAK_OUTSIDE_OF_LOOP]); | |
7060 } | |
7061 void test_breakOutsideOfLoop_breakInSwitchStatement() { | |
7062 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: break;}",
[]); | |
7063 } | |
7064 void test_breakOutsideOfLoop_breakInWhileStatement() { | |
7065 ParserTestCase.parse6("parseWhileStatement", "while (x) {break;}", []); | |
7066 } | |
7067 void test_breakOutsideOfLoop_functionExpression_inALoop() { | |
7068 ParserTestCase.parse6("parseStatement", "for(; x;) {() {break;};}", [ParserE
rrorCode.BREAK_OUTSIDE_OF_LOOP]); | |
7069 } | |
7070 void test_breakOutsideOfLoop_functionExpression_withALoop() { | |
7071 ParserTestCase.parse6("parseStatement", "() {for (; x;) {break;}};", []); | |
7072 } | |
7073 void test_constAndFinal() { | |
7074 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const final int x
;", [ParserErrorCode.CONST_AND_FINAL]); | |
7075 } | |
7076 void test_constAndVar() { | |
7077 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const var x;", [P
arserErrorCode.CONST_AND_VAR]); | |
7078 } | |
7079 void test_constClass() { | |
7080 ParserTestCase.parse6("parseCompilationUnit", "const class C {}", [ParserErr
orCode.CONST_CLASS]); | |
7081 } | |
7082 void test_constMethod() { | |
7083 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const int m() {}"
, [ParserErrorCode.CONST_METHOD]); | |
7084 } | |
7085 void test_constTypedef() { | |
7086 ParserTestCase.parse6("parseCompilationUnit", "const typedef F();", [ParserE
rrorCode.CONST_TYPEDEF]); | |
7087 } | |
7088 void test_continueOutsideOfLoop_continueInDoStatement() { | |
7089 ParserTestCase.parse6("parseDoStatement", "do {continue;} while (x);", []); | |
7090 } | |
7091 void test_continueOutsideOfLoop_continueInForStatement() { | |
7092 ParserTestCase.parse6("parseForStatement", "for (; x;) {continue;}", []); | |
7093 } | |
7094 void test_continueOutsideOfLoop_continueInIfStatement() { | |
7095 ParserTestCase.parse6("parseIfStatement", "if (x) {continue;}", [ParserError
Code.CONTINUE_OUTSIDE_OF_LOOP]); | |
7096 } | |
7097 void test_continueOutsideOfLoop_continueInSwitchStatement() { | |
7098 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); | |
7099 } | |
7100 void test_continueOutsideOfLoop_continueInWhileStatement() { | |
7101 ParserTestCase.parse6("parseWhileStatement", "while (x) {continue;}", []); | |
7102 } | |
7103 void test_continueOutsideOfLoop_functionExpression_inALoop() { | |
7104 ParserTestCase.parse6("parseStatement", "for(; x;) {() {continue;};}", [Pars
erErrorCode.CONTINUE_OUTSIDE_OF_LOOP]); | |
7105 } | |
7106 void test_continueOutsideOfLoop_functionExpression_withALoop() { | |
7107 ParserTestCase.parse6("parseStatement", "() {for (; x;) {continue;}};", []); | |
7108 } | |
7109 void test_continueWithoutLabelInCase_error() { | |
7110 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue;
}", [ParserErrorCode.CONTINUE_WITHOUT_LABEL_IN_CASE]); | |
7111 } | |
7112 void test_continueWithoutLabelInCase_noError() { | |
7113 ParserTestCase.parse6("parseSwitchStatement", "switch (x) {case 1: continue
a;}", []); | |
7114 } | |
7115 void test_continueWithoutLabelInCase_noError_switchInLoop() { | |
7116 ParserTestCase.parse6("parseWhileStatement", "while (a) { switch (b) {defaul
t: continue;}}", []); | |
7117 } | |
7118 void test_directiveAfterDeclaration_classBeforeDirective() { | |
7119 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "class
Foo{} library l;", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION]); | |
7120 JUnitTestCase.assertNotNull(unit); | |
7121 } | |
7122 void test_directiveAfterDeclaration_classBetweenDirectives() { | |
7123 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y l;\nclass Foo{}\npart 'a.dart';", [ParserErrorCode.DIRECTIVE_AFTER_DECLARATION
]); | |
7124 JUnitTestCase.assertNotNull(unit); | |
7125 } | |
7126 void test_duplicatedModifier_const() { | |
7127 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const const m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); | |
7128 } | |
7129 void test_duplicatedModifier_external() { | |
7130 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external external
f();", [ParserErrorCode.DUPLICATED_MODIFIER]); | |
7131 } | |
7132 void test_duplicatedModifier_factory() { | |
7133 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory factory C
() {}", [ParserErrorCode.DUPLICATED_MODIFIER]); | |
7134 } | |
7135 void test_duplicatedModifier_final() { | |
7136 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final final m;",
[ParserErrorCode.DUPLICATED_MODIFIER]); | |
7137 } | |
7138 void test_duplicatedModifier_static() { | |
7139 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static static m;"
, [ParserErrorCode.DUPLICATED_MODIFIER]); | |
7140 } | |
7141 void test_duplicatedModifier_var() { | |
7142 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var var m;", [Par
serErrorCode.DUPLICATED_MODIFIER]); | |
7143 } | |
7144 void test_duplicateLabelInSwitchStatement() { | |
7145 ParserTestCase.parse6("parseSwitchStatement", "switch (e) {l1: case 0: break
; l1: case 1: break;}", [ParserErrorCode.DUPLICATE_LABEL_IN_SWITCH_STATEMENT]); | |
7146 } | |
7147 void test_expectedCaseOrDefault() { | |
7148 ParserTestCase.parse6("parseSwitchStatement", "switch (e) {break;}", [Parser
ErrorCode.EXPECTED_CASE_OR_DEFAULT]); | |
7149 } | |
7150 void test_expectedStringLiteral() { | |
7151 StringLiteral expression = ParserTestCase.parse6("parseStringLiteral", "1",
[ParserErrorCode.EXPECTED_STRING_LITERAL]); | |
7152 JUnitTestCase.assertTrue(expression.isSynthetic()); | |
7153 } | |
7154 void test_expectedToken_commaMissingInArgumentList() { | |
7155 ParserTestCase.parse6("parseArgumentList", "(x, y z)", [ParserErrorCode.EXPE
CTED_TOKEN]); | |
7156 } | |
7157 void test_expectedToken_semicolonMissingAfterExpression() { | |
7158 ParserTestCase.parse6("parseStatement", "x", [ParserErrorCode.EXPECTED_TOKEN
]); | |
7159 } | |
7160 void test_expectedToken_whileMissingInDoStatement() { | |
7161 ParserTestCase.parse6("parseStatement", "do {} (x);", [ParserErrorCode.EXPEC
TED_TOKEN]); | |
7162 } | |
7163 void test_exportDirectiveAfterPartDirective() { | |
7164 ParserTestCase.parse6("parseCompilationUnit", "part 'a.dart'; export 'b.dart
';", [ParserErrorCode.EXPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); | |
7165 } | |
7166 void test_externalAfterConst() { | |
7167 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const external C(
);", [ParserErrorCode.EXTERNAL_AFTER_CONST]); | |
7168 } | |
7169 void test_externalAfterFactory() { | |
7170 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory external
C();", [ParserErrorCode.EXTERNAL_AFTER_FACTORY]); | |
7171 } | |
7172 void test_externalAfterStatic() { | |
7173 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static external i
nt m();", [ParserErrorCode.EXTERNAL_AFTER_STATIC]); | |
7174 } | |
7175 void test_externalClass() { | |
7176 ParserTestCase.parse6("parseCompilationUnit", "external class C {}", [Parser
ErrorCode.EXTERNAL_CLASS]); | |
7177 } | |
7178 void test_externalConstructorWithBody_factory() { | |
7179 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external factory
C() {}", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); | |
7180 } | |
7181 void test_externalConstructorWithBody_named() { | |
7182 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external C.c() {}
", [ParserErrorCode.EXTERNAL_CONSTRUCTOR_WITH_BODY]); | |
7183 } | |
7184 void test_externalField_const() { | |
7185 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external const A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | |
7186 } | |
7187 void test_externalField_final() { | |
7188 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external final A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | |
7189 } | |
7190 void test_externalField_static() { | |
7191 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external static A
f;", [ParserErrorCode.EXTERNAL_FIELD]); | |
7192 } | |
7193 void test_externalField_typed() { | |
7194 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external A f;", [
ParserErrorCode.EXTERNAL_FIELD]); | |
7195 } | |
7196 void test_externalField_untyped() { | |
7197 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external var f;",
[ParserErrorCode.EXTERNAL_FIELD]); | |
7198 } | |
7199 void test_externalGetterWithBody() { | |
7200 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external int get
x {}", [ParserErrorCode.EXTERNAL_GETTER_WITH_BODY]); | |
7201 } | |
7202 void test_externalMethodWithBody() { | |
7203 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external m() {}",
[ParserErrorCode.EXTERNAL_METHOD_WITH_BODY]); | |
7204 } | |
7205 void test_externalOperatorWithBody() { | |
7206 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external operator
+(int value) {}", [ParserErrorCode.EXTERNAL_OPERATOR_WITH_BODY]); | |
7207 } | |
7208 void test_externalSetterWithBody() { | |
7209 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "external set x(in
t value) {}", [ParserErrorCode.EXTERNAL_SETTER_WITH_BODY]); | |
7210 } | |
7211 void test_externalTypedef() { | |
7212 ParserTestCase.parse6("parseCompilationUnit", "external typedef F();", [Pars
erErrorCode.EXTERNAL_TYPEDEF]); | |
7213 } | |
7214 void test_factoryTopLevelDeclaration_class() { | |
7215 ParserTestCase.parse6("parseCompilationUnit", "factory class C {}", [ParserE
rrorCode.FACTORY_TOP_LEVEL_DECLARATION]); | |
7216 } | |
7217 void test_factoryTopLevelDeclaration_typedef() { | |
7218 ParserTestCase.parse6("parseCompilationUnit", "factory typedef F();", [Parse
rErrorCode.FACTORY_TOP_LEVEL_DECLARATION]); | |
7219 } | |
7220 void test_fieldInitializerOutsideConstructor() { | |
7221 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void m(this.x);",
[ParserErrorCode.FIELD_INITIALIZER_OUTSIDE_CONSTRUCTOR]); | |
7222 } | |
7223 void test_finalAndVar() { | |
7224 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final var x;", [P
arserErrorCode.FINAL_AND_VAR]); | |
7225 } | |
7226 void test_finalClass() { | |
7227 ParserTestCase.parse6("parseCompilationUnit", "final class C {}", [ParserErr
orCode.FINAL_CLASS]); | |
7228 } | |
7229 void test_finalConstructor() { | |
7230 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final C() {}", [P
arserErrorCode.FINAL_CONSTRUCTOR]); | |
7231 } | |
7232 void test_finalMethod() { | |
7233 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final int m() {}"
, [ParserErrorCode.FINAL_METHOD]); | |
7234 } | |
7235 void test_finalTypedef() { | |
7236 ParserTestCase.parse6("parseCompilationUnit", "final typedef F();", [ParserE
rrorCode.FINAL_TYPEDEF]); | |
7237 } | |
7238 void test_getterWithParameters() { | |
7239 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "int get x() {}",
[ParserErrorCode.GETTER_WITH_PARAMETERS]); | |
7240 } | |
7241 void test_illegalAssignmentToNonAssignable_superAssigned() { | |
7242 ParserTestCase.parse6("parseExpression", "super = x;", [ParserErrorCode.MISS
ING_ASSIGNABLE_SELECTOR, ParserErrorCode.ILLEGAL_ASSIGNMENT_TO_NON_ASSIGNABLE]); | |
7243 } | |
7244 void test_implementsBeforeExtends() { | |
7245 ParserTestCase.parse6("parseCompilationUnit", "class A implements B extends
C {}", [ParserErrorCode.IMPLEMENTS_BEFORE_EXTENDS]); | |
7246 } | |
7247 void test_implementsBeforeWith() { | |
7248 ParserTestCase.parse6("parseCompilationUnit", "class A extends B implements
C with D {}", [ParserErrorCode.IMPLEMENTS_BEFORE_WITH]); | |
7249 } | |
7250 void test_importDirectiveAfterPartDirective() { | |
7251 ParserTestCase.parse6("parseCompilationUnit", "part 'a.dart'; import 'b.dart
';", [ParserErrorCode.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE]); | |
7252 } | |
7253 void test_initializedVariableInForEach() { | |
7254 ParserTestCase.parse6("parseForStatement", "for (int a = 0 in foo) {}", [Par
serErrorCode.INITIALIZED_VARIABLE_IN_FOR_EACH]); | |
7255 } | |
7256 void test_invalidCodePoint() { | |
7257 ParserTestCase.parse6("parseStringLiteral", "'\\uD900'", [ParserErrorCode.IN
VALID_CODE_POINT]); | |
7258 } | |
7259 void test_invalidHexEscape_invalidDigit() { | |
7260 ParserTestCase.parse6("parseStringLiteral", "'\\x0 a'", [ParserErrorCode.INV
ALID_HEX_ESCAPE]); | |
7261 } | |
7262 void test_invalidHexEscape_tooFewDigits() { | |
7263 ParserTestCase.parse6("parseStringLiteral", "'\\x0'", [ParserErrorCode.INVAL
ID_HEX_ESCAPE]); | |
7264 } | |
7265 void test_invalidOperatorForSuper() { | |
7266 ParserTestCase.parse6("parseUnaryExpression", "++super", [ParserErrorCode.IN
VALID_OPERATOR_FOR_SUPER]); | |
7267 } | |
7268 void test_invalidUnicodeEscape_incomplete_noDigits() { | |
7269 ParserTestCase.parse6("parseStringLiteral", "'\\u{'", [ParserErrorCode.INVAL
ID_UNICODE_ESCAPE]); | |
7270 } | |
7271 void test_invalidUnicodeEscape_incomplete_someDigits() { | |
7272 ParserTestCase.parse6("parseStringLiteral", "'\\u{0A'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); | |
7273 } | |
7274 void test_invalidUnicodeEscape_invalidDigit() { | |
7275 ParserTestCase.parse6("parseStringLiteral", "'\\u0 a'", [ParserErrorCode.INV
ALID_UNICODE_ESCAPE]); | |
7276 } | |
7277 void test_invalidUnicodeEscape_tooFewDigits_fixed() { | |
7278 ParserTestCase.parse6("parseStringLiteral", "'\\u04'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); | |
7279 } | |
7280 void test_invalidUnicodeEscape_tooFewDigits_variable() { | |
7281 ParserTestCase.parse6("parseStringLiteral", "'\\u{}'", [ParserErrorCode.INVA
LID_UNICODE_ESCAPE]); | |
7282 } | |
7283 void test_invalidUnicodeEscape_tooManyDigits_variable() { | |
7284 ParserTestCase.parse6("parseStringLiteral", "'\\u{12345678}'", [ParserErrorC
ode.INVALID_UNICODE_ESCAPE, ParserErrorCode.INVALID_CODE_POINT]); | |
7285 } | |
7286 void test_libraryDirectiveNotFirst() { | |
7287 ParserTestCase.parse6("parseCompilationUnit", "import 'x.dart'; library l;",
[ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); | |
7288 } | |
7289 void test_libraryDirectiveNotFirst_afterPart() { | |
7290 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part '
a.dart';\nlibrary l;", [ParserErrorCode.LIBRARY_DIRECTIVE_NOT_FIRST]); | |
7291 JUnitTestCase.assertNotNull(unit); | |
7292 } | |
7293 void test_missingAssignableSelector_identifiersAssigned() { | |
7294 ParserTestCase.parse6("parseExpression", "x.y = y;", []); | |
7295 } | |
7296 void test_missingAssignableSelector_primarySelectorPostfix() { | |
7297 ParserTestCase.parse6("parseExpression", "x(y)(z)++", [ParserErrorCode.MISSI
NG_ASSIGNABLE_SELECTOR]); | |
7298 } | |
7299 void test_missingAssignableSelector_selector() { | |
7300 ParserTestCase.parse6("parseExpression", "x(y)(z).a++", []); | |
7301 } | |
7302 void test_missingAssignableSelector_superPrimaryExpression() { | |
7303 SuperExpression expression = ParserTestCase.parse6("parsePrimaryExpression",
"super", [ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR]); | |
7304 JUnitTestCase.assertNotNull(expression.keyword); | |
7305 } | |
7306 void test_missingAssignableSelector_superPropertyAccessAssigned() { | |
7307 ParserTestCase.parse6("parseExpression", "super.x = x;", []); | |
7308 } | |
7309 void test_missingCatchOrFinally() { | |
7310 TryStatement statement = ParserTestCase.parse6("parseTryStatement", "try {}"
, [ParserErrorCode.MISSING_CATCH_OR_FINALLY]); | |
7311 JUnitTestCase.assertNotNull(statement); | |
7312 } | |
7313 void test_missingClassBody() { | |
7314 ParserTestCase.parse6("parseCompilationUnit", "class A class B {}", [ParserE
rrorCode.MISSING_CLASS_BODY]); | |
7315 } | |
7316 void test_missingConstFinalVarOrType() { | |
7317 ParserTestCase.parse5("parseFinalConstVarOrType", <Object> [false], "a;", [P
arserErrorCode.MISSING_CONST_FINAL_VAR_OR_TYPE]); | |
7318 } | |
7319 void test_missingFunctionBody_emptyNotAllowed() { | |
7320 ParserTestCase.parse5("parseFunctionBody", <Object> [false, false], ";", [Pa
rserErrorCode.MISSING_FUNCTION_BODY]); | |
7321 } | |
7322 void test_missingFunctionBody_invalid() { | |
7323 ParserTestCase.parse5("parseFunctionBody", <Object> [false, false], "return
0;", [ParserErrorCode.MISSING_FUNCTION_BODY]); | |
7324 } | |
7325 void test_missingFunctionParameters_local_void_block() { | |
7326 ParserTestCase.parse6("parseStatement", "void f { return x;}", [ParserErrorC
ode.MISSING_FUNCTION_PARAMETERS]); | |
7327 } | |
7328 void test_missingFunctionParameters_local_void_expression() { | |
7329 ParserTestCase.parse6("parseStatement", "void f => x;", [ParserErrorCode.MIS
SING_FUNCTION_PARAMETERS]); | |
7330 } | |
7331 void test_missingFunctionParameters_topLevel_nonVoid_block() { | |
7332 ParserTestCase.parse6("parseCompilationUnit", "int f { return x;}", [ParserE
rrorCode.MISSING_FUNCTION_PARAMETERS]); | |
7333 } | |
7334 void test_missingFunctionParameters_topLevel_nonVoid_expression() { | |
7335 ParserTestCase.parse6("parseCompilationUnit", "int f => x;", [ParserErrorCod
e.MISSING_FUNCTION_PARAMETERS]); | |
7336 } | |
7337 void test_missingFunctionParameters_topLevel_void_block() { | |
7338 ParserTestCase.parse6("parseCompilationUnit", "void f { return x;}", [Parser
ErrorCode.MISSING_FUNCTION_PARAMETERS]); | |
7339 } | |
7340 void test_missingFunctionParameters_topLevel_void_expression() { | |
7341 ParserTestCase.parse6("parseCompilationUnit", "void f => x;", [ParserErrorCo
de.MISSING_FUNCTION_PARAMETERS]); | |
7342 } | |
7343 void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() { | |
7344 ParserTestCase.parse6("parseFunctionDeclarationStatement", "A<T> () {}", [Pa
rserErrorCode.MISSING_IDENTIFIER]); | |
7345 } | |
7346 void test_missingIdentifier_number() { | |
7347 SimpleIdentifier expression = ParserTestCase.parse6("parseSimpleIdentifier",
"1", [ParserErrorCode.MISSING_IDENTIFIER]); | |
7348 JUnitTestCase.assertTrue(expression.isSynthetic()); | |
7349 } | |
7350 void test_missingNameInLibraryDirective() { | |
7351 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y;", [ParserErrorCode.MISSING_NAME_IN_LIBRARY_DIRECTIVE]); | |
7352 JUnitTestCase.assertNotNull(unit); | |
7353 } | |
7354 void test_missingNameInPartOfDirective() { | |
7355 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part o
f;", [ParserErrorCode.MISSING_NAME_IN_PART_OF_DIRECTIVE]); | |
7356 JUnitTestCase.assertNotNull(unit); | |
7357 } | |
7358 void test_missingTerminatorForParameterGroup_named() { | |
7359 ParserTestCase.parse6("parseFormalParameterList", "(a, {b: 0)", [ParserError
Code.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]); | |
7360 } | |
7361 void test_missingTerminatorForParameterGroup_optional() { | |
7362 ParserTestCase.parse6("parseFormalParameterList", "(a, [b = 0)", [ParserErro
rCode.MISSING_TERMINATOR_FOR_PARAMETER_GROUP]); | |
7363 } | |
7364 void test_missingTypedefParameters_nonVoid() { | |
7365 ParserTestCase.parse6("parseCompilationUnit", "typedef int F;", [ParserError
Code.MISSING_TYPEDEF_PARAMETERS]); | |
7366 } | |
7367 void test_missingTypedefParameters_typeParameters() { | |
7368 ParserTestCase.parse6("parseCompilationUnit", "typedef F<E>;", [ParserErrorC
ode.MISSING_TYPEDEF_PARAMETERS]); | |
7369 } | |
7370 void test_missingTypedefParameters_void() { | |
7371 ParserTestCase.parse6("parseCompilationUnit", "typedef void F;", [ParserErro
rCode.MISSING_TYPEDEF_PARAMETERS]); | |
7372 } | |
7373 void test_missingVariableInForEach() { | |
7374 ParserTestCase.parse6("parseForStatement", "for (a < b in foo) {}", [ParserE
rrorCode.MISSING_VARIABLE_IN_FOR_EACH]); | |
7375 } | |
7376 void test_mixedParameterGroups_namedPositional() { | |
7377 ParserTestCase.parse6("parseFormalParameterList", "(a, {b}, [c])", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); | |
7378 } | |
7379 void test_mixedParameterGroups_positionalNamed() { | |
7380 ParserTestCase.parse6("parseFormalParameterList", "(a, [b], {c})", [ParserEr
rorCode.MIXED_PARAMETER_GROUPS]); | |
7381 } | |
7382 void test_multipleLibraryDirectives() { | |
7383 ParserTestCase.parse6("parseCompilationUnit", "library l; library m;", [Pars
erErrorCode.MULTIPLE_LIBRARY_DIRECTIVES]); | |
7384 } | |
7385 void test_multipleNamedParameterGroups() { | |
7386 ParserTestCase.parse6("parseFormalParameterList", "(a, {b}, {c})", [ParserEr
rorCode.MULTIPLE_NAMED_PARAMETER_GROUPS]); | |
7387 } | |
7388 void test_multiplePartOfDirectives() { | |
7389 ParserTestCase.parse6("parseCompilationUnit", "part of l; part of m;", [Pars
erErrorCode.MULTIPLE_PART_OF_DIRECTIVES]); | |
7390 } | |
7391 void test_multiplePositionalParameterGroups() { | |
7392 ParserTestCase.parse6("parseFormalParameterList", "(a, [b], [c])", [ParserEr
rorCode.MULTIPLE_POSITIONAL_PARAMETER_GROUPS]); | |
7393 } | |
7394 void test_multipleVariablesInForEach() { | |
7395 ParserTestCase.parse6("parseForStatement", "for (int a, b in foo) {}", [Pars
erErrorCode.MULTIPLE_VARIABLES_IN_FOR_EACH]); | |
7396 } | |
7397 void test_namedParameterOutsideGroup() { | |
7398 ParserTestCase.parse6("parseFormalParameterList", "(a, b : 0)", [ParserError
Code.NAMED_PARAMETER_OUTSIDE_GROUP]); | |
7399 } | |
7400 void test_nonConstructorFactory_field() { | |
7401 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory int x;",
[ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); | |
7402 } | |
7403 void test_nonConstructorFactory_method() { | |
7404 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "factory int m() {
}", [ParserErrorCode.NON_CONSTRUCTOR_FACTORY]); | |
7405 } | |
7406 void test_nonIdentifierLibraryName_library() { | |
7407 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "librar
y 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | |
7408 JUnitTestCase.assertNotNull(unit); | |
7409 } | |
7410 void test_nonIdentifierLibraryName_partOf() { | |
7411 CompilationUnit unit = ParserTestCase.parse6("parseCompilationUnit", "part o
f 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | |
7412 JUnitTestCase.assertNotNull(unit); | |
7413 } | |
7414 void test_nonPartOfDirectiveInPart_after() { | |
7415 ParserTestCase.parse6("parseCompilationUnit", "part of l; part 'f.dart';", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | |
7416 } | |
7417 void test_nonPartOfDirectiveInPart_before() { | |
7418 ParserTestCase.parse6("parseCompilationUnit", "part 'f.dart'; part of m;", [
ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | |
7419 } | |
7420 void test_nonUserDefinableOperator() { | |
7421 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "operator +=(int x
) => x + 1;", [ParserErrorCode.NON_USER_DEFINABLE_OPERATOR]); | |
7422 } | |
7423 void test_positionalAfterNamedArgument() { | |
7424 ParserTestCase.parse6("parseArgumentList", "(x: 1, 2)", [ParserErrorCode.POS
ITIONAL_AFTER_NAMED_ARGUMENT]); | |
7425 } | |
7426 void test_positionalParameterOutsideGroup() { | |
7427 ParserTestCase.parse6("parseFormalParameterList", "(a, b = 0)", [ParserError
Code.POSITIONAL_PARAMETER_OUTSIDE_GROUP]); | |
7428 } | |
7429 void test_staticAfterConst() { | |
7430 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "final static int
f;", [ParserErrorCode.STATIC_AFTER_FINAL]); | |
7431 } | |
7432 void test_staticAfterFinal() { | |
7433 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "const static int
f;", [ParserErrorCode.STATIC_AFTER_CONST]); | |
7434 } | |
7435 void test_staticAfterVar() { | |
7436 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var static f;", [
ParserErrorCode.STATIC_AFTER_VAR]); | |
7437 } | |
7438 void test_staticConstructor() { | |
7439 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static C.m() {}",
[ParserErrorCode.STATIC_CONSTRUCTOR]); | |
7440 } | |
7441 void test_staticOperator_noReturnType() { | |
7442 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static operator +
(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); | |
7443 } | |
7444 void test_staticOperator_returnType() { | |
7445 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "static int operat
or +(int x) => x + 1;", [ParserErrorCode.STATIC_OPERATOR]); | |
7446 } | |
7447 void test_staticTopLevelDeclaration_class() { | |
7448 ParserTestCase.parse6("parseCompilationUnit", "static class C {}", [ParserEr
rorCode.STATIC_TOP_LEVEL_DECLARATION]); | |
7449 } | |
7450 void test_staticTopLevelDeclaration_typedef() { | |
7451 ParserTestCase.parse6("parseCompilationUnit", "static typedef F();", [Parser
ErrorCode.STATIC_TOP_LEVEL_DECLARATION]); | |
7452 } | |
7453 void test_staticTopLevelDeclaration_variable() { | |
7454 ParserTestCase.parse6("parseCompilationUnit", "static var x;", [ParserErrorC
ode.STATIC_TOP_LEVEL_DECLARATION]); | |
7455 } | |
7456 void test_unexpectedTerminatorForParameterGroup_named() { | |
7457 ParserTestCase.parse6("parseFormalParameterList", "(a, b})", [ParserErrorCod
e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); | |
7458 } | |
7459 void test_unexpectedTerminatorForParameterGroup_optional() { | |
7460 ParserTestCase.parse6("parseFormalParameterList", "(a, b])", [ParserErrorCod
e.UNEXPECTED_TERMINATOR_FOR_PARAMETER_GROUP]); | |
7461 } | |
7462 void test_unexpectedToken_semicolonBetweenClassMembers() { | |
7463 ParserTestCase.parse5("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class C { int x; ; int y;}", [ParserErrorCode.UNEXPECTED_TOKEN])
; | |
7464 } | |
7465 void test_unexpectedToken_semicolonBetweenCompilationUnitMembers() { | |
7466 ParserTestCase.parse6("parseCompilationUnit", "int x; ; int y;", [ParserErro
rCode.UNEXPECTED_TOKEN]); | |
7467 } | |
7468 void test_useOfUnaryPlusOperator() { | |
7469 ParserTestCase.parse6("parseUnaryExpression", "+x", [ParserErrorCode.USE_OF_
UNARY_PLUS_OPERATOR]); | |
7470 } | |
7471 void test_varClass() { | |
7472 ParserTestCase.parse6("parseCompilationUnit", "var class C {}", [ParserError
Code.VAR_CLASS]); | |
7473 } | |
7474 void test_varConstructor() { | |
7475 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var C() {}", [Par
serErrorCode.CONSTRUCTOR_WITH_RETURN_TYPE]); | |
7476 } | |
7477 void test_varReturnType() { | |
7478 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "var m() {}", [Par
serErrorCode.VAR_RETURN_TYPE]); | |
7479 } | |
7480 void test_varTypedef() { | |
7481 ParserTestCase.parse6("parseCompilationUnit", "var typedef F();", [ParserErr
orCode.VAR_TYPEDEF]); | |
7482 } | |
7483 void test_voidField_initializer() { | |
7484 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void x = 0;", [Pa
rserErrorCode.VOID_VARIABLE]); | |
7485 } | |
7486 void test_voidField_noInitializer() { | |
7487 ParserTestCase.parse5("parseClassMember", <Object> ["C"], "void x;", [Parser
ErrorCode.VOID_VARIABLE]); | |
7488 } | |
7489 void test_voidParameter() { | |
7490 ParserTestCase.parse6("parseNormalFormalParameter", "void a)", [ParserErrorC
ode.VOID_PARAMETER]); | |
7491 } | |
7492 void test_withBeforeExtends() { | |
7493 ParserTestCase.parse6("parseCompilationUnit", "class A with B extends C {}",
[ParserErrorCode.WITH_BEFORE_EXTENDS]); | |
7494 } | |
7495 void test_withWithoutExtends() { | |
7496 ParserTestCase.parse5("parseClassDeclaration", <Object> [emptyCommentAndMeta
data(), null], "class A with B, C {}", [ParserErrorCode.WITH_WITHOUT_EXTENDS]); | |
7497 } | |
7498 void test_wrongSeparatorForNamedParameter() { | |
7499 ParserTestCase.parse6("parseFormalParameterList", "(a, {b = 0})", [ParserErr
orCode.WRONG_SEPARATOR_FOR_NAMED_PARAMETER]); | |
7500 } | |
7501 void test_wrongSeparatorForPositionalParameter() { | |
7502 ParserTestCase.parse6("parseFormalParameterList", "(a, [b : 0])", [ParserErr
orCode.WRONG_SEPARATOR_FOR_POSITIONAL_PARAMETER]); | |
7503 } | |
7504 void test_wrongTerminatorForParameterGroup_named() { | |
7505 ParserTestCase.parse6("parseFormalParameterList", "(a, {b, c])", [ParserErro
rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]); | |
7506 } | |
7507 void test_wrongTerminatorForParameterGroup_optional() { | |
7508 ParserTestCase.parse6("parseFormalParameterList", "(a, [b, c})", [ParserErro
rCode.WRONG_TERMINATOR_FOR_PARAMETER_GROUP]); | |
7509 } | |
7510 static dartSuite() { | |
7511 _ut.group('ErrorParserTest', () { | |
7512 _ut.test('test_abstractClassMember_constructor', () { | |
7513 final __test = new ErrorParserTest(); | |
7514 runJUnitTest(__test, __test.test_abstractClassMember_constructor); | |
7515 }); | |
7516 _ut.test('test_abstractClassMember_field', () { | |
7517 final __test = new ErrorParserTest(); | |
7518 runJUnitTest(__test, __test.test_abstractClassMember_field); | |
7519 }); | |
7520 _ut.test('test_abstractClassMember_getter', () { | |
7521 final __test = new ErrorParserTest(); | |
7522 runJUnitTest(__test, __test.test_abstractClassMember_getter); | |
7523 }); | |
7524 _ut.test('test_abstractClassMember_method', () { | |
7525 final __test = new ErrorParserTest(); | |
7526 runJUnitTest(__test, __test.test_abstractClassMember_method); | |
7527 }); | |
7528 _ut.test('test_abstractClassMember_setter', () { | |
7529 final __test = new ErrorParserTest(); | |
7530 runJUnitTest(__test, __test.test_abstractClassMember_setter); | |
7531 }); | |
7532 _ut.test('test_abstractTopLevelFunction_function', () { | |
7533 final __test = new ErrorParserTest(); | |
7534 runJUnitTest(__test, __test.test_abstractTopLevelFunction_function); | |
7535 }); | |
7536 _ut.test('test_abstractTopLevelFunction_getter', () { | |
7537 final __test = new ErrorParserTest(); | |
7538 runJUnitTest(__test, __test.test_abstractTopLevelFunction_getter); | |
7539 }); | |
7540 _ut.test('test_abstractTopLevelFunction_setter', () { | |
7541 final __test = new ErrorParserTest(); | |
7542 runJUnitTest(__test, __test.test_abstractTopLevelFunction_setter); | |
7543 }); | |
7544 _ut.test('test_abstractTopLevelVariable', () { | |
7545 final __test = new ErrorParserTest(); | |
7546 runJUnitTest(__test, __test.test_abstractTopLevelVariable); | |
7547 }); | |
7548 _ut.test('test_abstractTypeDef', () { | |
7549 final __test = new ErrorParserTest(); | |
7550 runJUnitTest(__test, __test.test_abstractTypeDef); | |
7551 }); | |
7552 _ut.test('test_breakOutsideOfLoop_breakInDoStatement', () { | |
7553 final __test = new ErrorParserTest(); | |
7554 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInDoStatement); | |
7555 }); | |
7556 _ut.test('test_breakOutsideOfLoop_breakInForStatement', () { | |
7557 final __test = new ErrorParserTest(); | |
7558 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInForStatement)
; | |
7559 }); | |
7560 _ut.test('test_breakOutsideOfLoop_breakInIfStatement', () { | |
7561 final __test = new ErrorParserTest(); | |
7562 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInIfStatement); | |
7563 }); | |
7564 _ut.test('test_breakOutsideOfLoop_breakInSwitchStatement', () { | |
7565 final __test = new ErrorParserTest(); | |
7566 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInSwitchStateme
nt); | |
7567 }); | |
7568 _ut.test('test_breakOutsideOfLoop_breakInWhileStatement', () { | |
7569 final __test = new ErrorParserTest(); | |
7570 runJUnitTest(__test, __test.test_breakOutsideOfLoop_breakInWhileStatemen
t); | |
7571 }); | |
7572 _ut.test('test_breakOutsideOfLoop_functionExpression_inALoop', () { | |
7573 final __test = new ErrorParserTest(); | |
7574 runJUnitTest(__test, __test.test_breakOutsideOfLoop_functionExpression_i
nALoop); | |
7575 }); | |
7576 _ut.test('test_breakOutsideOfLoop_functionExpression_withALoop', () { | |
7577 final __test = new ErrorParserTest(); | |
7578 runJUnitTest(__test, __test.test_breakOutsideOfLoop_functionExpression_w
ithALoop); | |
7579 }); | |
7580 _ut.test('test_constAndFinal', () { | |
7581 final __test = new ErrorParserTest(); | |
7582 runJUnitTest(__test, __test.test_constAndFinal); | |
7583 }); | |
7584 _ut.test('test_constAndVar', () { | |
7585 final __test = new ErrorParserTest(); | |
7586 runJUnitTest(__test, __test.test_constAndVar); | |
7587 }); | |
7588 _ut.test('test_constClass', () { | |
7589 final __test = new ErrorParserTest(); | |
7590 runJUnitTest(__test, __test.test_constClass); | |
7591 }); | |
7592 _ut.test('test_constMethod', () { | |
7593 final __test = new ErrorParserTest(); | |
7594 runJUnitTest(__test, __test.test_constMethod); | |
7595 }); | |
7596 _ut.test('test_constTypedef', () { | |
7597 final __test = new ErrorParserTest(); | |
7598 runJUnitTest(__test, __test.test_constTypedef); | |
7599 }); | |
7600 _ut.test('test_continueOutsideOfLoop_continueInDoStatement', () { | |
7601 final __test = new ErrorParserTest(); | |
7602 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInDoState
ment); | |
7603 }); | |
7604 _ut.test('test_continueOutsideOfLoop_continueInForStatement', () { | |
7605 final __test = new ErrorParserTest(); | |
7606 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInForStat
ement); | |
7607 }); | |
7608 _ut.test('test_continueOutsideOfLoop_continueInIfStatement', () { | |
7609 final __test = new ErrorParserTest(); | |
7610 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInIfState
ment); | |
7611 }); | |
7612 _ut.test('test_continueOutsideOfLoop_continueInSwitchStatement', () { | |
7613 final __test = new ErrorParserTest(); | |
7614 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInSwitchS
tatement); | |
7615 }); | |
7616 _ut.test('test_continueOutsideOfLoop_continueInWhileStatement', () { | |
7617 final __test = new ErrorParserTest(); | |
7618 runJUnitTest(__test, __test.test_continueOutsideOfLoop_continueInWhileSt
atement); | |
7619 }); | |
7620 _ut.test('test_continueOutsideOfLoop_functionExpression_inALoop', () { | |
7621 final __test = new ErrorParserTest(); | |
7622 runJUnitTest(__test, __test.test_continueOutsideOfLoop_functionExpressio
n_inALoop); | |
7623 }); | |
7624 _ut.test('test_continueOutsideOfLoop_functionExpression_withALoop', () { | |
7625 final __test = new ErrorParserTest(); | |
7626 runJUnitTest(__test, __test.test_continueOutsideOfLoop_functionExpressio
n_withALoop); | |
7627 }); | |
7628 _ut.test('test_continueWithoutLabelInCase_error', () { | |
7629 final __test = new ErrorParserTest(); | |
7630 runJUnitTest(__test, __test.test_continueWithoutLabelInCase_error); | |
7631 }); | |
7632 _ut.test('test_continueWithoutLabelInCase_noError', () { | |
7633 final __test = new ErrorParserTest(); | |
7634 runJUnitTest(__test, __test.test_continueWithoutLabelInCase_noError); | |
7635 }); | |
7636 _ut.test('test_continueWithoutLabelInCase_noError_switchInLoop', () { | |
7637 final __test = new ErrorParserTest(); | |
7638 runJUnitTest(__test, __test.test_continueWithoutLabelInCase_noError_swit
chInLoop); | |
7639 }); | |
7640 _ut.test('test_directiveAfterDeclaration_classBeforeDirective', () { | |
7641 final __test = new ErrorParserTest(); | |
7642 runJUnitTest(__test, __test.test_directiveAfterDeclaration_classBeforeDi
rective); | |
7643 }); | |
7644 _ut.test('test_directiveAfterDeclaration_classBetweenDirectives', () { | |
7645 final __test = new ErrorParserTest(); | |
7646 runJUnitTest(__test, __test.test_directiveAfterDeclaration_classBetweenD
irectives); | |
7647 }); | |
7648 _ut.test('test_duplicateLabelInSwitchStatement', () { | |
7649 final __test = new ErrorParserTest(); | |
7650 runJUnitTest(__test, __test.test_duplicateLabelInSwitchStatement); | |
7651 }); | |
7652 _ut.test('test_duplicatedModifier_const', () { | |
7653 final __test = new ErrorParserTest(); | |
7654 runJUnitTest(__test, __test.test_duplicatedModifier_const); | |
7655 }); | |
7656 _ut.test('test_duplicatedModifier_external', () { | |
7657 final __test = new ErrorParserTest(); | |
7658 runJUnitTest(__test, __test.test_duplicatedModifier_external); | |
7659 }); | |
7660 _ut.test('test_duplicatedModifier_factory', () { | |
7661 final __test = new ErrorParserTest(); | |
7662 runJUnitTest(__test, __test.test_duplicatedModifier_factory); | |
7663 }); | |
7664 _ut.test('test_duplicatedModifier_final', () { | |
7665 final __test = new ErrorParserTest(); | |
7666 runJUnitTest(__test, __test.test_duplicatedModifier_final); | |
7667 }); | |
7668 _ut.test('test_duplicatedModifier_static', () { | |
7669 final __test = new ErrorParserTest(); | |
7670 runJUnitTest(__test, __test.test_duplicatedModifier_static); | |
7671 }); | |
7672 _ut.test('test_duplicatedModifier_var', () { | |
7673 final __test = new ErrorParserTest(); | |
7674 runJUnitTest(__test, __test.test_duplicatedModifier_var); | |
7675 }); | |
7676 _ut.test('test_expectedCaseOrDefault', () { | |
7677 final __test = new ErrorParserTest(); | |
7678 runJUnitTest(__test, __test.test_expectedCaseOrDefault); | |
7679 }); | |
7680 _ut.test('test_expectedStringLiteral', () { | |
7681 final __test = new ErrorParserTest(); | |
7682 runJUnitTest(__test, __test.test_expectedStringLiteral); | |
7683 }); | |
7684 _ut.test('test_expectedToken_commaMissingInArgumentList', () { | |
7685 final __test = new ErrorParserTest(); | |
7686 runJUnitTest(__test, __test.test_expectedToken_commaMissingInArgumentLis
t); | |
7687 }); | |
7688 _ut.test('test_expectedToken_semicolonMissingAfterExpression', () { | |
7689 final __test = new ErrorParserTest(); | |
7690 runJUnitTest(__test, __test.test_expectedToken_semicolonMissingAfterExpr
ession); | |
7691 }); | |
7692 _ut.test('test_expectedToken_whileMissingInDoStatement', () { | |
7693 final __test = new ErrorParserTest(); | |
7694 runJUnitTest(__test, __test.test_expectedToken_whileMissingInDoStatement
); | |
7695 }); | |
7696 _ut.test('test_exportDirectiveAfterPartDirective', () { | |
7697 final __test = new ErrorParserTest(); | |
7698 runJUnitTest(__test, __test.test_exportDirectiveAfterPartDirective); | |
7699 }); | |
7700 _ut.test('test_externalAfterConst', () { | |
7701 final __test = new ErrorParserTest(); | |
7702 runJUnitTest(__test, __test.test_externalAfterConst); | |
7703 }); | |
7704 _ut.test('test_externalAfterFactory', () { | |
7705 final __test = new ErrorParserTest(); | |
7706 runJUnitTest(__test, __test.test_externalAfterFactory); | |
7707 }); | |
7708 _ut.test('test_externalAfterStatic', () { | |
7709 final __test = new ErrorParserTest(); | |
7710 runJUnitTest(__test, __test.test_externalAfterStatic); | |
7711 }); | |
7712 _ut.test('test_externalClass', () { | |
7713 final __test = new ErrorParserTest(); | |
7714 runJUnitTest(__test, __test.test_externalClass); | |
7715 }); | |
7716 _ut.test('test_externalConstructorWithBody_factory', () { | |
7717 final __test = new ErrorParserTest(); | |
7718 runJUnitTest(__test, __test.test_externalConstructorWithBody_factory); | |
7719 }); | |
7720 _ut.test('test_externalConstructorWithBody_named', () { | |
7721 final __test = new ErrorParserTest(); | |
7722 runJUnitTest(__test, __test.test_externalConstructorWithBody_named); | |
7723 }); | |
7724 _ut.test('test_externalField_const', () { | |
7725 final __test = new ErrorParserTest(); | |
7726 runJUnitTest(__test, __test.test_externalField_const); | |
7727 }); | |
7728 _ut.test('test_externalField_final', () { | |
7729 final __test = new ErrorParserTest(); | |
7730 runJUnitTest(__test, __test.test_externalField_final); | |
7731 }); | |
7732 _ut.test('test_externalField_static', () { | |
7733 final __test = new ErrorParserTest(); | |
7734 runJUnitTest(__test, __test.test_externalField_static); | |
7735 }); | |
7736 _ut.test('test_externalField_typed', () { | |
7737 final __test = new ErrorParserTest(); | |
7738 runJUnitTest(__test, __test.test_externalField_typed); | |
7739 }); | |
7740 _ut.test('test_externalField_untyped', () { | |
7741 final __test = new ErrorParserTest(); | |
7742 runJUnitTest(__test, __test.test_externalField_untyped); | |
7743 }); | |
7744 _ut.test('test_externalGetterWithBody', () { | |
7745 final __test = new ErrorParserTest(); | |
7746 runJUnitTest(__test, __test.test_externalGetterWithBody); | |
7747 }); | |
7748 _ut.test('test_externalMethodWithBody', () { | |
7749 final __test = new ErrorParserTest(); | |
7750 runJUnitTest(__test, __test.test_externalMethodWithBody); | |
7751 }); | |
7752 _ut.test('test_externalOperatorWithBody', () { | |
7753 final __test = new ErrorParserTest(); | |
7754 runJUnitTest(__test, __test.test_externalOperatorWithBody); | |
7755 }); | |
7756 _ut.test('test_externalSetterWithBody', () { | |
7757 final __test = new ErrorParserTest(); | |
7758 runJUnitTest(__test, __test.test_externalSetterWithBody); | |
7759 }); | |
7760 _ut.test('test_externalTypedef', () { | |
7761 final __test = new ErrorParserTest(); | |
7762 runJUnitTest(__test, __test.test_externalTypedef); | |
7763 }); | |
7764 _ut.test('test_factoryTopLevelDeclaration_class', () { | |
7765 final __test = new ErrorParserTest(); | |
7766 runJUnitTest(__test, __test.test_factoryTopLevelDeclaration_class); | |
7767 }); | |
7768 _ut.test('test_factoryTopLevelDeclaration_typedef', () { | |
7769 final __test = new ErrorParserTest(); | |
7770 runJUnitTest(__test, __test.test_factoryTopLevelDeclaration_typedef); | |
7771 }); | |
7772 _ut.test('test_fieldInitializerOutsideConstructor', () { | |
7773 final __test = new ErrorParserTest(); | |
7774 runJUnitTest(__test, __test.test_fieldInitializerOutsideConstructor); | |
7775 }); | |
7776 _ut.test('test_finalAndVar', () { | |
7777 final __test = new ErrorParserTest(); | |
7778 runJUnitTest(__test, __test.test_finalAndVar); | |
7779 }); | |
7780 _ut.test('test_finalClass', () { | |
7781 final __test = new ErrorParserTest(); | |
7782 runJUnitTest(__test, __test.test_finalClass); | |
7783 }); | |
7784 _ut.test('test_finalConstructor', () { | |
7785 final __test = new ErrorParserTest(); | |
7786 runJUnitTest(__test, __test.test_finalConstructor); | |
7787 }); | |
7788 _ut.test('test_finalMethod', () { | |
7789 final __test = new ErrorParserTest(); | |
7790 runJUnitTest(__test, __test.test_finalMethod); | |
7791 }); | |
7792 _ut.test('test_finalTypedef', () { | |
7793 final __test = new ErrorParserTest(); | |
7794 runJUnitTest(__test, __test.test_finalTypedef); | |
7795 }); | |
7796 _ut.test('test_getterWithParameters', () { | |
7797 final __test = new ErrorParserTest(); | |
7798 runJUnitTest(__test, __test.test_getterWithParameters); | |
7799 }); | |
7800 _ut.test('test_illegalAssignmentToNonAssignable_superAssigned', () { | |
7801 final __test = new ErrorParserTest(); | |
7802 runJUnitTest(__test, __test.test_illegalAssignmentToNonAssignable_superA
ssigned); | |
7803 }); | |
7804 _ut.test('test_implementsBeforeExtends', () { | |
7805 final __test = new ErrorParserTest(); | |
7806 runJUnitTest(__test, __test.test_implementsBeforeExtends); | |
7807 }); | |
7808 _ut.test('test_implementsBeforeWith', () { | |
7809 final __test = new ErrorParserTest(); | |
7810 runJUnitTest(__test, __test.test_implementsBeforeWith); | |
7811 }); | |
7812 _ut.test('test_importDirectiveAfterPartDirective', () { | |
7813 final __test = new ErrorParserTest(); | |
7814 runJUnitTest(__test, __test.test_importDirectiveAfterPartDirective); | |
7815 }); | |
7816 _ut.test('test_initializedVariableInForEach', () { | |
7817 final __test = new ErrorParserTest(); | |
7818 runJUnitTest(__test, __test.test_initializedVariableInForEach); | |
7819 }); | |
7820 _ut.test('test_invalidCodePoint', () { | |
7821 final __test = new ErrorParserTest(); | |
7822 runJUnitTest(__test, __test.test_invalidCodePoint); | |
7823 }); | |
7824 _ut.test('test_invalidHexEscape_invalidDigit', () { | |
7825 final __test = new ErrorParserTest(); | |
7826 runJUnitTest(__test, __test.test_invalidHexEscape_invalidDigit); | |
7827 }); | |
7828 _ut.test('test_invalidHexEscape_tooFewDigits', () { | |
7829 final __test = new ErrorParserTest(); | |
7830 runJUnitTest(__test, __test.test_invalidHexEscape_tooFewDigits); | |
7831 }); | |
7832 _ut.test('test_invalidOperatorForSuper', () { | |
7833 final __test = new ErrorParserTest(); | |
7834 runJUnitTest(__test, __test.test_invalidOperatorForSuper); | |
7835 }); | |
7836 _ut.test('test_invalidUnicodeEscape_incomplete_noDigits', () { | |
7837 final __test = new ErrorParserTest(); | |
7838 runJUnitTest(__test, __test.test_invalidUnicodeEscape_incomplete_noDigit
s); | |
7839 }); | |
7840 _ut.test('test_invalidUnicodeEscape_incomplete_someDigits', () { | |
7841 final __test = new ErrorParserTest(); | |
7842 runJUnitTest(__test, __test.test_invalidUnicodeEscape_incomplete_someDig
its); | |
7843 }); | |
7844 _ut.test('test_invalidUnicodeEscape_invalidDigit', () { | |
7845 final __test = new ErrorParserTest(); | |
7846 runJUnitTest(__test, __test.test_invalidUnicodeEscape_invalidDigit); | |
7847 }); | |
7848 _ut.test('test_invalidUnicodeEscape_tooFewDigits_fixed', () { | |
7849 final __test = new ErrorParserTest(); | |
7850 runJUnitTest(__test, __test.test_invalidUnicodeEscape_tooFewDigits_fixed
); | |
7851 }); | |
7852 _ut.test('test_invalidUnicodeEscape_tooFewDigits_variable', () { | |
7853 final __test = new ErrorParserTest(); | |
7854 runJUnitTest(__test, __test.test_invalidUnicodeEscape_tooFewDigits_varia
ble); | |
7855 }); | |
7856 _ut.test('test_invalidUnicodeEscape_tooManyDigits_variable', () { | |
7857 final __test = new ErrorParserTest(); | |
7858 runJUnitTest(__test, __test.test_invalidUnicodeEscape_tooManyDigits_vari
able); | |
7859 }); | |
7860 _ut.test('test_libraryDirectiveNotFirst', () { | |
7861 final __test = new ErrorParserTest(); | |
7862 runJUnitTest(__test, __test.test_libraryDirectiveNotFirst); | |
7863 }); | |
7864 _ut.test('test_libraryDirectiveNotFirst_afterPart', () { | |
7865 final __test = new ErrorParserTest(); | |
7866 runJUnitTest(__test, __test.test_libraryDirectiveNotFirst_afterPart); | |
7867 }); | |
7868 _ut.test('test_missingAssignableSelector_identifiersAssigned', () { | |
7869 final __test = new ErrorParserTest(); | |
7870 runJUnitTest(__test, __test.test_missingAssignableSelector_identifiersAs
signed); | |
7871 }); | |
7872 _ut.test('test_missingAssignableSelector_primarySelectorPostfix', () { | |
7873 final __test = new ErrorParserTest(); | |
7874 runJUnitTest(__test, __test.test_missingAssignableSelector_primarySelect
orPostfix); | |
7875 }); | |
7876 _ut.test('test_missingAssignableSelector_selector', () { | |
7877 final __test = new ErrorParserTest(); | |
7878 runJUnitTest(__test, __test.test_missingAssignableSelector_selector); | |
7879 }); | |
7880 _ut.test('test_missingAssignableSelector_superPrimaryExpression', () { | |
7881 final __test = new ErrorParserTest(); | |
7882 runJUnitTest(__test, __test.test_missingAssignableSelector_superPrimaryE
xpression); | |
7883 }); | |
7884 _ut.test('test_missingAssignableSelector_superPropertyAccessAssigned', ()
{ | |
7885 final __test = new ErrorParserTest(); | |
7886 runJUnitTest(__test, __test.test_missingAssignableSelector_superProperty
AccessAssigned); | |
7887 }); | |
7888 _ut.test('test_missingCatchOrFinally', () { | |
7889 final __test = new ErrorParserTest(); | |
7890 runJUnitTest(__test, __test.test_missingCatchOrFinally); | |
7891 }); | |
7892 _ut.test('test_missingClassBody', () { | |
7893 final __test = new ErrorParserTest(); | |
7894 runJUnitTest(__test, __test.test_missingClassBody); | |
7895 }); | |
7896 _ut.test('test_missingConstFinalVarOrType', () { | |
7897 final __test = new ErrorParserTest(); | |
7898 runJUnitTest(__test, __test.test_missingConstFinalVarOrType); | |
7899 }); | |
7900 _ut.test('test_missingFunctionBody_emptyNotAllowed', () { | |
7901 final __test = new ErrorParserTest(); | |
7902 runJUnitTest(__test, __test.test_missingFunctionBody_emptyNotAllowed); | |
7903 }); | |
7904 _ut.test('test_missingFunctionBody_invalid', () { | |
7905 final __test = new ErrorParserTest(); | |
7906 runJUnitTest(__test, __test.test_missingFunctionBody_invalid); | |
7907 }); | |
7908 _ut.test('test_missingFunctionParameters_local_void_block', () { | |
7909 final __test = new ErrorParserTest(); | |
7910 runJUnitTest(__test, __test.test_missingFunctionParameters_local_void_bl
ock); | |
7911 }); | |
7912 _ut.test('test_missingFunctionParameters_local_void_expression', () { | |
7913 final __test = new ErrorParserTest(); | |
7914 runJUnitTest(__test, __test.test_missingFunctionParameters_local_void_ex
pression); | |
7915 }); | |
7916 _ut.test('test_missingFunctionParameters_topLevel_nonVoid_block', () { | |
7917 final __test = new ErrorParserTest(); | |
7918 runJUnitTest(__test, __test.test_missingFunctionParameters_topLevel_nonV
oid_block); | |
7919 }); | |
7920 _ut.test('test_missingFunctionParameters_topLevel_nonVoid_expression', ()
{ | |
7921 final __test = new ErrorParserTest(); | |
7922 runJUnitTest(__test, __test.test_missingFunctionParameters_topLevel_nonV
oid_expression); | |
7923 }); | |
7924 _ut.test('test_missingFunctionParameters_topLevel_void_block', () { | |
7925 final __test = new ErrorParserTest(); | |
7926 runJUnitTest(__test, __test.test_missingFunctionParameters_topLevel_void
_block); | |
7927 }); | |
7928 _ut.test('test_missingFunctionParameters_topLevel_void_expression', () { | |
7929 final __test = new ErrorParserTest(); | |
7930 runJUnitTest(__test, __test.test_missingFunctionParameters_topLevel_void
_expression); | |
7931 }); | |
7932 _ut.test('test_missingIdentifier_functionDeclaration_returnTypeWithoutName
', () { | |
7933 final __test = new ErrorParserTest(); | |
7934 runJUnitTest(__test, __test.test_missingIdentifier_functionDeclaration_r
eturnTypeWithoutName); | |
7935 }); | |
7936 _ut.test('test_missingIdentifier_number', () { | |
7937 final __test = new ErrorParserTest(); | |
7938 runJUnitTest(__test, __test.test_missingIdentifier_number); | |
7939 }); | |
7940 _ut.test('test_missingNameInLibraryDirective', () { | |
7941 final __test = new ErrorParserTest(); | |
7942 runJUnitTest(__test, __test.test_missingNameInLibraryDirective); | |
7943 }); | |
7944 _ut.test('test_missingNameInPartOfDirective', () { | |
7945 final __test = new ErrorParserTest(); | |
7946 runJUnitTest(__test, __test.test_missingNameInPartOfDirective); | |
7947 }); | |
7948 _ut.test('test_missingTerminatorForParameterGroup_named', () { | |
7949 final __test = new ErrorParserTest(); | |
7950 runJUnitTest(__test, __test.test_missingTerminatorForParameterGroup_name
d); | |
7951 }); | |
7952 _ut.test('test_missingTerminatorForParameterGroup_optional', () { | |
7953 final __test = new ErrorParserTest(); | |
7954 runJUnitTest(__test, __test.test_missingTerminatorForParameterGroup_opti
onal); | |
7955 }); | |
7956 _ut.test('test_missingTypedefParameters_nonVoid', () { | |
7957 final __test = new ErrorParserTest(); | |
7958 runJUnitTest(__test, __test.test_missingTypedefParameters_nonVoid); | |
7959 }); | |
7960 _ut.test('test_missingTypedefParameters_typeParameters', () { | |
7961 final __test = new ErrorParserTest(); | |
7962 runJUnitTest(__test, __test.test_missingTypedefParameters_typeParameters
); | |
7963 }); | |
7964 _ut.test('test_missingTypedefParameters_void', () { | |
7965 final __test = new ErrorParserTest(); | |
7966 runJUnitTest(__test, __test.test_missingTypedefParameters_void); | |
7967 }); | |
7968 _ut.test('test_missingVariableInForEach', () { | |
7969 final __test = new ErrorParserTest(); | |
7970 runJUnitTest(__test, __test.test_missingVariableInForEach); | |
7971 }); | |
7972 _ut.test('test_mixedParameterGroups_namedPositional', () { | |
7973 final __test = new ErrorParserTest(); | |
7974 runJUnitTest(__test, __test.test_mixedParameterGroups_namedPositional); | |
7975 }); | |
7976 _ut.test('test_mixedParameterGroups_positionalNamed', () { | |
7977 final __test = new ErrorParserTest(); | |
7978 runJUnitTest(__test, __test.test_mixedParameterGroups_positionalNamed); | |
7979 }); | |
7980 _ut.test('test_multipleLibraryDirectives', () { | |
7981 final __test = new ErrorParserTest(); | |
7982 runJUnitTest(__test, __test.test_multipleLibraryDirectives); | |
7983 }); | |
7984 _ut.test('test_multipleNamedParameterGroups', () { | |
7985 final __test = new ErrorParserTest(); | |
7986 runJUnitTest(__test, __test.test_multipleNamedParameterGroups); | |
7987 }); | |
7988 _ut.test('test_multiplePartOfDirectives', () { | |
7989 final __test = new ErrorParserTest(); | |
7990 runJUnitTest(__test, __test.test_multiplePartOfDirectives); | |
7991 }); | |
7992 _ut.test('test_multiplePositionalParameterGroups', () { | |
7993 final __test = new ErrorParserTest(); | |
7994 runJUnitTest(__test, __test.test_multiplePositionalParameterGroups); | |
7995 }); | |
7996 _ut.test('test_multipleVariablesInForEach', () { | |
7997 final __test = new ErrorParserTest(); | |
7998 runJUnitTest(__test, __test.test_multipleVariablesInForEach); | |
7999 }); | |
8000 _ut.test('test_namedParameterOutsideGroup', () { | |
8001 final __test = new ErrorParserTest(); | |
8002 runJUnitTest(__test, __test.test_namedParameterOutsideGroup); | |
8003 }); | |
8004 _ut.test('test_nonConstructorFactory_field', () { | |
8005 final __test = new ErrorParserTest(); | |
8006 runJUnitTest(__test, __test.test_nonConstructorFactory_field); | |
8007 }); | |
8008 _ut.test('test_nonConstructorFactory_method', () { | |
8009 final __test = new ErrorParserTest(); | |
8010 runJUnitTest(__test, __test.test_nonConstructorFactory_method); | |
8011 }); | |
8012 _ut.test('test_nonIdentifierLibraryName_library', () { | |
8013 final __test = new ErrorParserTest(); | |
8014 runJUnitTest(__test, __test.test_nonIdentifierLibraryName_library); | |
8015 }); | |
8016 _ut.test('test_nonIdentifierLibraryName_partOf', () { | |
8017 final __test = new ErrorParserTest(); | |
8018 runJUnitTest(__test, __test.test_nonIdentifierLibraryName_partOf); | |
8019 }); | |
8020 _ut.test('test_nonPartOfDirectiveInPart_after', () { | |
8021 final __test = new ErrorParserTest(); | |
8022 runJUnitTest(__test, __test.test_nonPartOfDirectiveInPart_after); | |
8023 }); | |
8024 _ut.test('test_nonPartOfDirectiveInPart_before', () { | |
8025 final __test = new ErrorParserTest(); | |
8026 runJUnitTest(__test, __test.test_nonPartOfDirectiveInPart_before); | |
8027 }); | |
8028 _ut.test('test_nonUserDefinableOperator', () { | |
8029 final __test = new ErrorParserTest(); | |
8030 runJUnitTest(__test, __test.test_nonUserDefinableOperator); | |
8031 }); | |
8032 _ut.test('test_positionalAfterNamedArgument', () { | |
8033 final __test = new ErrorParserTest(); | |
8034 runJUnitTest(__test, __test.test_positionalAfterNamedArgument); | |
8035 }); | |
8036 _ut.test('test_positionalParameterOutsideGroup', () { | |
8037 final __test = new ErrorParserTest(); | |
8038 runJUnitTest(__test, __test.test_positionalParameterOutsideGroup); | |
8039 }); | |
8040 _ut.test('test_staticAfterConst', () { | |
8041 final __test = new ErrorParserTest(); | |
8042 runJUnitTest(__test, __test.test_staticAfterConst); | |
8043 }); | |
8044 _ut.test('test_staticAfterFinal', () { | |
8045 final __test = new ErrorParserTest(); | |
8046 runJUnitTest(__test, __test.test_staticAfterFinal); | |
8047 }); | |
8048 _ut.test('test_staticAfterVar', () { | |
8049 final __test = new ErrorParserTest(); | |
8050 runJUnitTest(__test, __test.test_staticAfterVar); | |
8051 }); | |
8052 _ut.test('test_staticConstructor', () { | |
8053 final __test = new ErrorParserTest(); | |
8054 runJUnitTest(__test, __test.test_staticConstructor); | |
8055 }); | |
8056 _ut.test('test_staticOperator_noReturnType', () { | |
8057 final __test = new ErrorParserTest(); | |
8058 runJUnitTest(__test, __test.test_staticOperator_noReturnType); | |
8059 }); | |
8060 _ut.test('test_staticOperator_returnType', () { | |
8061 final __test = new ErrorParserTest(); | |
8062 runJUnitTest(__test, __test.test_staticOperator_returnType); | |
8063 }); | |
8064 _ut.test('test_staticTopLevelDeclaration_class', () { | |
8065 final __test = new ErrorParserTest(); | |
8066 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_class); | |
8067 }); | |
8068 _ut.test('test_staticTopLevelDeclaration_typedef', () { | |
8069 final __test = new ErrorParserTest(); | |
8070 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_typedef); | |
8071 }); | |
8072 _ut.test('test_staticTopLevelDeclaration_variable', () { | |
8073 final __test = new ErrorParserTest(); | |
8074 runJUnitTest(__test, __test.test_staticTopLevelDeclaration_variable); | |
8075 }); | |
8076 _ut.test('test_unexpectedTerminatorForParameterGroup_named', () { | |
8077 final __test = new ErrorParserTest(); | |
8078 runJUnitTest(__test, __test.test_unexpectedTerminatorForParameterGroup_n
amed); | |
8079 }); | |
8080 _ut.test('test_unexpectedTerminatorForParameterGroup_optional', () { | |
8081 final __test = new ErrorParserTest(); | |
8082 runJUnitTest(__test, __test.test_unexpectedTerminatorForParameterGroup_o
ptional); | |
8083 }); | |
8084 _ut.test('test_unexpectedToken_semicolonBetweenClassMembers', () { | |
8085 final __test = new ErrorParserTest(); | |
8086 runJUnitTest(__test, __test.test_unexpectedToken_semicolonBetweenClassMe
mbers); | |
8087 }); | |
8088 _ut.test('test_unexpectedToken_semicolonBetweenCompilationUnitMembers', ()
{ | |
8089 final __test = new ErrorParserTest(); | |
8090 runJUnitTest(__test, __test.test_unexpectedToken_semicolonBetweenCompila
tionUnitMembers); | |
8091 }); | |
8092 _ut.test('test_useOfUnaryPlusOperator', () { | |
8093 final __test = new ErrorParserTest(); | |
8094 runJUnitTest(__test, __test.test_useOfUnaryPlusOperator); | |
8095 }); | |
8096 _ut.test('test_varClass', () { | |
8097 final __test = new ErrorParserTest(); | |
8098 runJUnitTest(__test, __test.test_varClass); | |
8099 }); | |
8100 _ut.test('test_varConstructor', () { | |
8101 final __test = new ErrorParserTest(); | |
8102 runJUnitTest(__test, __test.test_varConstructor); | |
8103 }); | |
8104 _ut.test('test_varReturnType', () { | |
8105 final __test = new ErrorParserTest(); | |
8106 runJUnitTest(__test, __test.test_varReturnType); | |
8107 }); | |
8108 _ut.test('test_varTypedef', () { | |
8109 final __test = new ErrorParserTest(); | |
8110 runJUnitTest(__test, __test.test_varTypedef); | |
8111 }); | |
8112 _ut.test('test_voidField_initializer', () { | |
8113 final __test = new ErrorParserTest(); | |
8114 runJUnitTest(__test, __test.test_voidField_initializer); | |
8115 }); | |
8116 _ut.test('test_voidField_noInitializer', () { | |
8117 final __test = new ErrorParserTest(); | |
8118 runJUnitTest(__test, __test.test_voidField_noInitializer); | |
8119 }); | |
8120 _ut.test('test_voidParameter', () { | |
8121 final __test = new ErrorParserTest(); | |
8122 runJUnitTest(__test, __test.test_voidParameter); | |
8123 }); | |
8124 _ut.test('test_withBeforeExtends', () { | |
8125 final __test = new ErrorParserTest(); | |
8126 runJUnitTest(__test, __test.test_withBeforeExtends); | |
8127 }); | |
8128 _ut.test('test_withWithoutExtends', () { | |
8129 final __test = new ErrorParserTest(); | |
8130 runJUnitTest(__test, __test.test_withWithoutExtends); | |
8131 }); | |
8132 _ut.test('test_wrongSeparatorForNamedParameter', () { | |
8133 final __test = new ErrorParserTest(); | |
8134 runJUnitTest(__test, __test.test_wrongSeparatorForNamedParameter); | |
8135 }); | |
8136 _ut.test('test_wrongSeparatorForPositionalParameter', () { | |
8137 final __test = new ErrorParserTest(); | |
8138 runJUnitTest(__test, __test.test_wrongSeparatorForPositionalParameter); | |
8139 }); | |
8140 _ut.test('test_wrongTerminatorForParameterGroup_named', () { | |
8141 final __test = new ErrorParserTest(); | |
8142 runJUnitTest(__test, __test.test_wrongTerminatorForParameterGroup_named)
; | |
8143 }); | |
8144 _ut.test('test_wrongTerminatorForParameterGroup_optional', () { | |
8145 final __test = new ErrorParserTest(); | |
8146 runJUnitTest(__test, __test.test_wrongTerminatorForParameterGroup_option
al); | |
8147 }); | |
8148 }); | |
8149 } | |
8150 } | |
8151 main() { | |
8152 ComplexParserTest.dartSuite(); | |
8153 ErrorParserTest.dartSuite(); | |
8154 RecoveryParserTest.dartSuite(); | |
8155 SimpleParserTest.dartSuite(); | |
8156 } | |
8157 Map<String, MethodTrampoline> _methodTable_Parser = <String, MethodTrampoline> { | |
8158 'parseCompilationUnit_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseCompilationUnit(arg0)), | |
8159 'parseExpression_1': new MethodTrampoline(1, (Parser target, arg0) => target.p
arseExpression(arg0)), | |
8160 'parseStatement_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa
rseStatement(arg0)), | |
8161 'parseStatements_1': new MethodTrampoline(1, (Parser target, arg0) => target.p
arseStatements(arg0)), | |
8162 'advance_0': new MethodTrampoline(0, (Parser target) => target.advance()), | |
8163 'appendScalarValue_5': new MethodTrampoline(5, (Parser target, arg0, arg1, arg
2, arg3, arg4) => target.appendScalarValue(arg0, arg1, arg2, arg3, arg4)), | |
8164 'computeStringValue_1': new MethodTrampoline(1, (Parser target, arg0) => targe
t.computeStringValue(arg0)), | |
8165 'createSyntheticIdentifier_0': new MethodTrampoline(0, (Parser target) => targ
et.createSyntheticIdentifier()), | |
8166 'createSyntheticStringLiteral_0': new MethodTrampoline(0, (Parser target) => t
arget.createSyntheticStringLiteral()), | |
8167 'createSyntheticToken_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.createSyntheticToken(arg0)), | |
8168 'ensureAssignable_1': new MethodTrampoline(1, (Parser target, arg0) => target.
ensureAssignable(arg0)), | |
8169 'expect_1': new MethodTrampoline(1, (Parser target, arg0) => target.expect(arg
0)), | |
8170 'hasReturnTypeInTypeAlias_0': new MethodTrampoline(0, (Parser target) => targe
t.hasReturnTypeInTypeAlias()), | |
8171 'isFunctionDeclaration_0': new MethodTrampoline(0, (Parser target) => target.i
sFunctionDeclaration()), | |
8172 'isFunctionExpression_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.isFunctionExpression(arg0)), | |
8173 'isHexDigit_1': new MethodTrampoline(1, (Parser target, arg0) => target.isHexD
igit(arg0)), | |
8174 'isInitializedVariableDeclaration_0': new MethodTrampoline(0, (Parser target)
=> target.isInitializedVariableDeclaration()), | |
8175 'isSwitchMember_0': new MethodTrampoline(0, (Parser target) => target.isSwitch
Member()), | |
8176 'lexicallyFirst_1': new MethodTrampoline(1, (Parser target, arg0) => target.le
xicallyFirst(arg0)), | |
8177 'matches_1': new MethodTrampoline(1, (Parser target, arg0) => target.matches(a
rg0)), | |
8178 'matches_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.mat
ches3(arg0, arg1)), | |
8179 'matchesAny_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target.
matchesAny(arg0, arg1)), | |
8180 'matchesIdentifier_0': new MethodTrampoline(0, (Parser target) => target.match
esIdentifier()), | |
8181 'matchesIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => target
.matchesIdentifier2(arg0)), | |
8182 'optional_1': new MethodTrampoline(1, (Parser target, arg0) => target.optional
(arg0)), | |
8183 'parseAdditiveExpression_0': new MethodTrampoline(0, (Parser target) => target
.parseAdditiveExpression()), | |
8184 'parseAnnotation_0': new MethodTrampoline(0, (Parser target) => target.parseAn
notation()), | |
8185 'parseArgument_0': new MethodTrampoline(0, (Parser target) => target.parseArgu
ment()), | |
8186 'parseArgumentDefinitionTest_0': new MethodTrampoline(0, (Parser target) => ta
rget.parseArgumentDefinitionTest()), | |
8187 'parseArgumentList_0': new MethodTrampoline(0, (Parser target) => target.parse
ArgumentList()), | |
8188 'parseAssertStatement_0': new MethodTrampoline(0, (Parser target) => target.pa
rseAssertStatement()), | |
8189 'parseAssignableExpression_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.parseAssignableExpression(arg0)), | |
8190 'parseAssignableSelector_2': new MethodTrampoline(2, (Parser target, arg0, arg
1) => target.parseAssignableSelector(arg0, arg1)), | |
8191 'parseBitwiseAndExpression_0': new MethodTrampoline(0, (Parser target) => targ
et.parseBitwiseAndExpression()), | |
8192 'parseBitwiseOrExpression_0': new MethodTrampoline(0, (Parser target) => targe
t.parseBitwiseOrExpression()), | |
8193 'parseBitwiseXorExpression_0': new MethodTrampoline(0, (Parser target) => targ
et.parseBitwiseXorExpression()), | |
8194 'parseBlock_0': new MethodTrampoline(0, (Parser target) => target.parseBlock()
), | |
8195 'parseBreakStatement_0': new MethodTrampoline(0, (Parser target) => target.par
seBreakStatement()), | |
8196 'parseCascadeSection_0': new MethodTrampoline(0, (Parser target) => target.par
seCascadeSection()), | |
8197 'parseClassDeclaration_2': new MethodTrampoline(2, (Parser target, arg0, arg1)
=> target.parseClassDeclaration(arg0, arg1)), | |
8198 'parseClassMember_1': new MethodTrampoline(1, (Parser target, arg0) => target.
parseClassMember(arg0)), | |
8199 'parseClassMembers_2': new MethodTrampoline(2, (Parser target, arg0, arg1) =>
target.parseClassMembers(arg0, arg1)), | |
8200 'parseClassTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1) =
> target.parseClassTypeAlias(arg0, arg1)), | |
8201 'parseCombinators_0': new MethodTrampoline(0, (Parser target) => target.parseC
ombinators()), | |
8202 'parseCommentAndMetadata_0': new MethodTrampoline(0, (Parser target) => target
.parseCommentAndMetadata()), | |
8203 'parseCommentReference_2': new MethodTrampoline(2, (Parser target, arg0, arg1)
=> target.parseCommentReference(arg0, arg1)), | |
8204 'parseCommentReferences_1': new MethodTrampoline(1, (Parser target, arg0) => t
arget.parseCommentReferences(arg0)), | |
8205 'parseCompilationUnit_0': new MethodTrampoline(0, (Parser target) => target.pa
rseCompilationUnit2()), | |
8206 'parseCompilationUnitMember_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.parseCompilationUnitMember(arg0)), | |
8207 'parseConditionalExpression_0': new MethodTrampoline(0, (Parser target) => tar
get.parseConditionalExpression()), | |
8208 'parseConstExpression_0': new MethodTrampoline(0, (Parser target) => target.pa
rseConstExpression()), | |
8209 'parseConstructor_8': new MethodTrampoline(8, (Parser target, arg0, arg1, arg2
, arg3, arg4, arg5, arg6, arg7) => target.parseConstructor(arg0, arg1, arg2, arg
3, arg4, arg5, arg6, arg7)), | |
8210 'parseConstructorFieldInitializer_0': new MethodTrampoline(0, (Parser target)
=> target.parseConstructorFieldInitializer()), | |
8211 'parseConstructorName_0': new MethodTrampoline(0, (Parser target) => target.pa
rseConstructorName()), | |
8212 'parseContinueStatement_0': new MethodTrampoline(0, (Parser target) => target.
parseContinueStatement()), | |
8213 'parseDirective_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa
rseDirective(arg0)), | |
8214 'parseDocumentationComment_0': new MethodTrampoline(0, (Parser target) => targ
et.parseDocumentationComment()), | |
8215 'parseDoStatement_0': new MethodTrampoline(0, (Parser target) => target.parseD
oStatement()), | |
8216 'parseEmptyStatement_0': new MethodTrampoline(0, (Parser target) => target.par
seEmptyStatement()), | |
8217 'parseEqualityExpression_0': new MethodTrampoline(0, (Parser target) => target
.parseEqualityExpression()), | |
8218 'parseExportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseExportDirective(arg0)), | |
8219 'parseExpression_0': new MethodTrampoline(0, (Parser target) => target.parseEx
pression2()), | |
8220 'parseExpressionList_0': new MethodTrampoline(0, (Parser target) => target.par
seExpressionList()), | |
8221 'parseExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target) =>
target.parseExpressionWithoutCascade()), | |
8222 'parseExtendsClause_0': new MethodTrampoline(0, (Parser target) => target.pars
eExtendsClause()), | |
8223 'parseFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.parseFinalConstVarOrType(arg0)), | |
8224 'parseFormalParameter_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseFormalParameter(arg0)), | |
8225 'parseFormalParameterList_0': new MethodTrampoline(0, (Parser target) => targe
t.parseFormalParameterList()), | |
8226 'parseForStatement_0': new MethodTrampoline(0, (Parser target) => target.parse
ForStatement()), | |
8227 'parseFunctionBody_2': new MethodTrampoline(2, (Parser target, arg0, arg1) =>
target.parseFunctionBody(arg0, arg1)), | |
8228 'parseFunctionDeclaration_3': new MethodTrampoline(3, (Parser target, arg0, ar
g1, arg2) => target.parseFunctionDeclaration(arg0, arg1, arg2)), | |
8229 'parseFunctionDeclarationStatement_0': new MethodTrampoline(0, (Parser target)
=> target.parseFunctionDeclarationStatement()), | |
8230 'parseFunctionDeclarationStatement_2': new MethodTrampoline(2, (Parser target,
arg0, arg1) => target.parseFunctionDeclarationStatement2(arg0, arg1)), | |
8231 'parseFunctionExpression_0': new MethodTrampoline(0, (Parser target) => target
.parseFunctionExpression()), | |
8232 'parseFunctionTypeAlias_2': new MethodTrampoline(2, (Parser target, arg0, arg1
) => target.parseFunctionTypeAlias(arg0, arg1)), | |
8233 'parseGetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg
3) => target.parseGetter(arg0, arg1, arg2, arg3)), | |
8234 'parseIdentifierList_0': new MethodTrampoline(0, (Parser target) => target.par
seIdentifierList()), | |
8235 'parseIfStatement_0': new MethodTrampoline(0, (Parser target) => target.parseI
fStatement()), | |
8236 'parseImplementsClause_0': new MethodTrampoline(0, (Parser target) => target.p
arseImplementsClause()), | |
8237 'parseImportDirective_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.parseImportDirective(arg0)), | |
8238 'parseInitializedIdentifierList_4': new MethodTrampoline(4, (Parser target, ar
g0, arg1, arg2, arg3) => target.parseInitializedIdentifierList(arg0, arg1, arg2,
arg3)), | |
8239 'parseInstanceCreationExpression_1': new MethodTrampoline(1, (Parser target, a
rg0) => target.parseInstanceCreationExpression(arg0)), | |
8240 'parseLibraryDirective_1': new MethodTrampoline(1, (Parser target, arg0) => ta
rget.parseLibraryDirective(arg0)), | |
8241 'parseLibraryIdentifier_0': new MethodTrampoline(0, (Parser target) => target.
parseLibraryIdentifier()), | |
8242 'parseLibraryName_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => t
arget.parseLibraryName(arg0, arg1)), | |
8243 'parseListLiteral_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => t
arget.parseListLiteral(arg0, arg1)), | |
8244 'parseListOrMapLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => ta
rget.parseListOrMapLiteral(arg0)), | |
8245 'parseLogicalAndExpression_0': new MethodTrampoline(0, (Parser target) => targ
et.parseLogicalAndExpression()), | |
8246 'parseLogicalOrExpression_0': new MethodTrampoline(0, (Parser target) => targe
t.parseLogicalOrExpression()), | |
8247 'parseMapLiteral_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => ta
rget.parseMapLiteral(arg0, arg1)), | |
8248 'parseMapLiteralEntry_0': new MethodTrampoline(0, (Parser target) => target.pa
rseMapLiteralEntry()), | |
8249 'parseMethodDeclaration_4': new MethodTrampoline(4, (Parser target, arg0, arg1
, arg2, arg3) => target.parseMethodDeclaration(arg0, arg1, arg2, arg3)), | |
8250 'parseMethodDeclaration_6': new MethodTrampoline(6, (Parser target, arg0, arg1
, arg2, arg3, arg4, arg5) => target.parseMethodDeclaration2(arg0, arg1, arg2, ar
g3, arg4, arg5)), | |
8251 'parseModifiers_0': new MethodTrampoline(0, (Parser target) => target.parseMod
ifiers()), | |
8252 'parseMultiplicativeExpression_0': new MethodTrampoline(0, (Parser target) =>
target.parseMultiplicativeExpression()), | |
8253 'parseNewExpression_0': new MethodTrampoline(0, (Parser target) => target.pars
eNewExpression()), | |
8254 'parseNonLabeledStatement_0': new MethodTrampoline(0, (Parser target) => targe
t.parseNonLabeledStatement()), | |
8255 'parseNormalFormalParameter_0': new MethodTrampoline(0, (Parser target) => tar
get.parseNormalFormalParameter()), | |
8256 'parseOperator_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) =
> target.parseOperator(arg0, arg1, arg2)), | |
8257 'parseOptionalReturnType_0': new MethodTrampoline(0, (Parser target) => target
.parseOptionalReturnType()), | |
8258 'parsePartDirective_1': new MethodTrampoline(1, (Parser target, arg0) => targe
t.parsePartDirective(arg0)), | |
8259 'parsePostfixExpression_0': new MethodTrampoline(0, (Parser target) => target.
parsePostfixExpression()), | |
8260 'parsePrefixedIdentifier_0': new MethodTrampoline(0, (Parser target) => target
.parsePrefixedIdentifier()), | |
8261 'parsePrimaryExpression_0': new MethodTrampoline(0, (Parser target) => target.
parsePrimaryExpression()), | |
8262 'parseRedirectingConstructorInvocation_0': new MethodTrampoline(0, (Parser tar
get) => target.parseRedirectingConstructorInvocation()), | |
8263 'parseRelationalExpression_0': new MethodTrampoline(0, (Parser target) => targ
et.parseRelationalExpression()), | |
8264 'parseReturnStatement_0': new MethodTrampoline(0, (Parser target) => target.pa
rseReturnStatement()), | |
8265 'parseReturnType_0': new MethodTrampoline(0, (Parser target) => target.parseRe
turnType()), | |
8266 'parseSetter_4': new MethodTrampoline(4, (Parser target, arg0, arg1, arg2, arg
3) => target.parseSetter(arg0, arg1, arg2, arg3)), | |
8267 'parseShiftExpression_0': new MethodTrampoline(0, (Parser target) => target.pa
rseShiftExpression()), | |
8268 'parseSimpleIdentifier_0': new MethodTrampoline(0, (Parser target) => target.p
arseSimpleIdentifier()), | |
8269 'parseStatement_0': new MethodTrampoline(0, (Parser target) => target.parseSta
tement2()), | |
8270 'parseStatements_0': new MethodTrampoline(0, (Parser target) => target.parseSt
atements2()), | |
8271 'parseStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.parseStringInterpolation(arg0)), | |
8272 'parseStringLiteral_0': new MethodTrampoline(0, (Parser target) => target.pars
eStringLiteral()), | |
8273 'parseSuperConstructorInvocation_0': new MethodTrampoline(0, (Parser target) =
> target.parseSuperConstructorInvocation()), | |
8274 'parseSwitchStatement_0': new MethodTrampoline(0, (Parser target) => target.pa
rseSwitchStatement()), | |
8275 'parseThrowExpression_0': new MethodTrampoline(0, (Parser target) => target.pa
rseThrowExpression()), | |
8276 'parseThrowExpressionWithoutCascade_0': new MethodTrampoline(0, (Parser target
) => target.parseThrowExpressionWithoutCascade()), | |
8277 'parseTryStatement_0': new MethodTrampoline(0, (Parser target) => target.parse
TryStatement()), | |
8278 'parseTypeAlias_1': new MethodTrampoline(1, (Parser target, arg0) => target.pa
rseTypeAlias(arg0)), | |
8279 'parseTypeArgumentList_0': new MethodTrampoline(0, (Parser target) => target.p
arseTypeArgumentList()), | |
8280 'parseTypeName_0': new MethodTrampoline(0, (Parser target) => target.parseType
Name()), | |
8281 'parseTypeParameter_0': new MethodTrampoline(0, (Parser target) => target.pars
eTypeParameter()), | |
8282 'parseTypeParameterList_0': new MethodTrampoline(0, (Parser target) => target.
parseTypeParameterList()), | |
8283 'parseUnaryExpression_0': new MethodTrampoline(0, (Parser target) => target.pa
rseUnaryExpression()), | |
8284 'parseVariableDeclaration_0': new MethodTrampoline(0, (Parser target) => targe
t.parseVariableDeclaration()), | |
8285 'parseVariableDeclarationList_0': new MethodTrampoline(0, (Parser target) => t
arget.parseVariableDeclarationList()), | |
8286 'parseVariableDeclarationList_2': new MethodTrampoline(2, (Parser target, arg0
, arg1) => target.parseVariableDeclarationList2(arg0, arg1)), | |
8287 'parseVariableDeclarationStatement_0': new MethodTrampoline(0, (Parser target)
=> target.parseVariableDeclarationStatement()), | |
8288 'parseWhileStatement_0': new MethodTrampoline(0, (Parser target) => target.par
seWhileStatement()), | |
8289 'parseWithClause_0': new MethodTrampoline(0, (Parser target) => target.parseWi
thClause()), | |
8290 'peek_0': new MethodTrampoline(0, (Parser target) => target.peek()), | |
8291 'peek_1': new MethodTrampoline(1, (Parser target, arg0) => target.peek2(arg0))
, | |
8292 'reportError_3': new MethodTrampoline(3, (Parser target, arg0, arg1, arg2) =>
target.reportError(arg0, arg1, arg2)), | |
8293 'reportError_2': new MethodTrampoline(2, (Parser target, arg0, arg1) => target
.reportError4(arg0, arg1)), | |
8294 'skipFinalConstVarOrType_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipFinalConstVarOrType(arg0)), | |
8295 'skipFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipFormalParameterList(arg0)), | |
8296 'skipPastMatchingToken_1': new MethodTrampoline(1, (Parser target, arg0) => ta
rget.skipPastMatchingToken(arg0)), | |
8297 'skipPrefixedIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => t
arget.skipPrefixedIdentifier(arg0)), | |
8298 'skipReturnType_1': new MethodTrampoline(1, (Parser target, arg0) => target.sk
ipReturnType(arg0)), | |
8299 'skipSimpleIdentifier_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.skipSimpleIdentifier(arg0)), | |
8300 'skipStringInterpolation_1': new MethodTrampoline(1, (Parser target, arg0) =>
target.skipStringInterpolation(arg0)), | |
8301 'skipStringLiteral_1': new MethodTrampoline(1, (Parser target, arg0) => target
.skipStringLiteral(arg0)), | |
8302 'skipTypeArgumentList_1': new MethodTrampoline(1, (Parser target, arg0) => tar
get.skipTypeArgumentList(arg0)), | |
8303 'skipTypeName_1': new MethodTrampoline(1, (Parser target, arg0) => target.skip
TypeName(arg0)), | |
8304 'skipTypeParameterList_1': new MethodTrampoline(1, (Parser target, arg0) => ta
rget.skipTypeParameterList(arg0)), | |
8305 'translateCharacter_3': new MethodTrampoline(3, (Parser target, arg0, arg1, ar
g2) => target.translateCharacter(arg0, arg1, arg2)), | |
8306 'validateFormalParameterList_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateFormalParameterList(arg0)), | |
8307 'validateModifiersForClass_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.validateModifiersForClass(arg0)), | |
8308 'validateModifiersForConstructor_1': new MethodTrampoline(1, (Parser target, a
rg0) => target.validateModifiersForConstructor(arg0)), | |
8309 'validateModifiersForField_1': new MethodTrampoline(1, (Parser target, arg0) =
> target.validateModifiersForField(arg0)), | |
8310 'validateModifiersForGetterOrSetterOrMethod_1': new MethodTrampoline(1, (Parse
r target, arg0) => target.validateModifiersForGetterOrSetterOrMethod(arg0)), | |
8311 'validateModifiersForOperator_1': new MethodTrampoline(1, (Parser target, arg0
) => target.validateModifiersForOperator(arg0)), | |
8312 'validateModifiersForTopLevelDeclaration_1': new MethodTrampoline(1, (Parser t
arget, arg0) => target.validateModifiersForTopLevelDeclaration(arg0)), | |
8313 'validateModifiersForTopLevelFunction_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelFunction(arg0)), | |
8314 'validateModifiersForTopLevelVariable_1': new MethodTrampoline(1, (Parser targ
et, arg0) => target.validateModifiersForTopLevelVariable(arg0)), | |
8315 'validateModifiersForTypedef_1': new MethodTrampoline(1, (Parser target, arg0)
=> target.validateModifiersForTypedef(arg0)),}; | |
8316 | |
8317 | |
8318 Object invokeParserMethodImpl(Parser parser, String methodName, List<Object> obj
ects, Token tokenStream) { | |
8319 parser.currentToken = tokenStream; | |
8320 MethodTrampoline method = _methodTable_Parser['${methodName}_${objects.length}
']; | |
8321 return method.invoke(parser, objects); | |
8322 } | |
OLD | NEW |