Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(772)

Side by Side Diff: pkg/analyzer/test/generated/utilities_test.dart

Issue 712083003: Create fewer unnecessary lists (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/test/generated/test_support.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.utilities_test; 8 library engine.utilities_test;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 void test_visitAnnotation_constant() { 46 void test_visitAnnotation_constant() {
47 _assertClone(AstFactory.annotation(AstFactory.identifier3("A"))); 47 _assertClone(AstFactory.annotation(AstFactory.identifier3("A")));
48 } 48 }
49 49
50 void test_visitAnnotation_constructor() { 50 void test_visitAnnotation_constructor() {
51 _assertClone( 51 _assertClone(
52 AstFactory.annotation2( 52 AstFactory.annotation2(
53 AstFactory.identifier3("A"), 53 AstFactory.identifier3("A"),
54 AstFactory.identifier3("c"), 54 AstFactory.identifier3("c"),
55 AstFactory.argumentList([]))); 55 AstFactory.argumentList()));
56 } 56 }
57 57
58 void test_visitArgumentList() { 58 void test_visitArgumentList() {
59 _assertClone( 59 _assertClone(
60 AstFactory.argumentList( 60 AstFactory.argumentList(
61 [AstFactory.identifier3("a"), AstFactory.identifier3("b")])); 61 [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
62 } 62 }
63 63
64 void test_visitAsExpression() { 64 void test_visitAsExpression() {
65 _assertClone( 65 _assertClone(
66 AstFactory.asExpression( 66 AstFactory.asExpression(
67 AstFactory.identifier3("e"), 67 AstFactory.identifier3("e"),
68 AstFactory.typeName4("T", []))); 68 AstFactory.typeName4("T")));
69 } 69 }
70 70
71 void test_visitAssertStatement() { 71 void test_visitAssertStatement() {
72 _assertClone(AstFactory.assertStatement(AstFactory.identifier3("a"))); 72 _assertClone(AstFactory.assertStatement(AstFactory.identifier3("a")));
73 } 73 }
74 74
75 void test_visitAssignmentExpression() { 75 void test_visitAssignmentExpression() {
76 _assertClone( 76 _assertClone(
77 AstFactory.assignmentExpression( 77 AstFactory.assignmentExpression(
78 AstFactory.identifier3("a"), 78 AstFactory.identifier3("a"),
79 TokenType.EQ, 79 TokenType.EQ,
80 AstFactory.identifier3("b"))); 80 AstFactory.identifier3("b")));
81 } 81 }
82 82
83 void test_visitAwaitExpression() { 83 void test_visitAwaitExpression() {
84 _assertClone(AstFactory.awaitExpression(AstFactory.identifier3("a"))); 84 _assertClone(AstFactory.awaitExpression(AstFactory.identifier3("a")));
85 } 85 }
86 86
87 void test_visitBinaryExpression() { 87 void test_visitBinaryExpression() {
88 _assertClone( 88 _assertClone(
89 AstFactory.binaryExpression( 89 AstFactory.binaryExpression(
90 AstFactory.identifier3("a"), 90 AstFactory.identifier3("a"),
91 TokenType.PLUS, 91 TokenType.PLUS,
92 AstFactory.identifier3("b"))); 92 AstFactory.identifier3("b")));
93 } 93 }
94 94
95 void test_visitBlockFunctionBody() { 95 void test_visitBlockFunctionBody() {
96 _assertClone(AstFactory.blockFunctionBody2([])); 96 _assertClone(AstFactory.blockFunctionBody2());
97 } 97 }
98 98
99 void test_visitBlock_empty() { 99 void test_visitBlock_empty() {
100 _assertClone(AstFactory.block([])); 100 _assertClone(AstFactory.block());
101 } 101 }
102 102
103 void test_visitBlock_nonEmpty() { 103 void test_visitBlock_nonEmpty() {
104 _assertClone( 104 _assertClone(
105 AstFactory.block([AstFactory.breakStatement(), AstFactory.breakStatement ()])); 105 AstFactory.block([AstFactory.breakStatement(), AstFactory.breakStatement ()]));
106 } 106 }
107 107
108 void test_visitBooleanLiteral_false() { 108 void test_visitBooleanLiteral_false() {
109 _assertClone(AstFactory.booleanLiteral(false)); 109 _assertClone(AstFactory.booleanLiteral(false));
110 } 110 }
(...skipping 26 matching lines...) Expand all
137 [ 137 [
138 AstFactory.cascadedIndexExpression(AstFactory.integer(0)), 138 AstFactory.cascadedIndexExpression(AstFactory.integer(0)),
139 AstFactory.cascadedIndexExpression(AstFactory.integer(1))])); 139 AstFactory.cascadedIndexExpression(AstFactory.integer(1))]));
140 } 140 }
141 141
142 void test_visitCascadeExpression_method() { 142 void test_visitCascadeExpression_method() {
143 _assertClone( 143 _assertClone(
144 AstFactory.cascadeExpression( 144 AstFactory.cascadeExpression(
145 AstFactory.identifier3("a"), 145 AstFactory.identifier3("a"),
146 [ 146 [
147 AstFactory.cascadedMethodInvocation("b", []), 147 AstFactory.cascadedMethodInvocation("b"),
148 AstFactory.cascadedMethodInvocation("c", [])])); 148 AstFactory.cascadedMethodInvocation("c")]));
149 } 149 }
150 150
151 void test_visitCatchClause_catch_noStack() { 151 void test_visitCatchClause_catch_noStack() {
152 _assertClone(AstFactory.catchClause("e", [])); 152 _assertClone(AstFactory.catchClause("e"));
153 } 153 }
154 154
155 void test_visitCatchClause_catch_stack() { 155 void test_visitCatchClause_catch_stack() {
156 _assertClone(AstFactory.catchClause2("e", "s", [])); 156 _assertClone(AstFactory.catchClause2("e", "s"));
157 } 157 }
158 158
159 void test_visitCatchClause_on() { 159 void test_visitCatchClause_on() {
160 _assertClone(AstFactory.catchClause3(AstFactory.typeName4("E", []), [])); 160 _assertClone(AstFactory.catchClause3(AstFactory.typeName4("E")));
161 } 161 }
162 162
163 void test_visitCatchClause_on_catch() { 163 void test_visitCatchClause_on_catch() {
164 _assertClone( 164 _assertClone(
165 AstFactory.catchClause4(AstFactory.typeName4("E", []), "e", [])); 165 AstFactory.catchClause4(AstFactory.typeName4("E"), "e"));
166 } 166 }
167 167
168 void test_visitClassDeclaration_abstract() { 168 void test_visitClassDeclaration_abstract() {
169 _assertClone( 169 _assertClone(
170 AstFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, nul l, [])); 170 AstFactory.classDeclaration(Keyword.ABSTRACT, "C", null, null, null, nul l));
171 } 171 }
172 172
173 void test_visitClassDeclaration_empty() { 173 void test_visitClassDeclaration_empty() {
174 _assertClone( 174 _assertClone(
175 AstFactory.classDeclaration(null, "C", null, null, null, null, [])); 175 AstFactory.classDeclaration(null, "C", null, null, null, null));
176 } 176 }
177 177
178 void test_visitClassDeclaration_extends() { 178 void test_visitClassDeclaration_extends() {
179 _assertClone( 179 _assertClone(
180 AstFactory.classDeclaration( 180 AstFactory.classDeclaration(
181 null, 181 null,
182 "C", 182 "C",
183 null, 183 null,
184 AstFactory.extendsClause(AstFactory.typeName4("A", [])), 184 AstFactory.extendsClause(AstFactory.typeName4("A")),
185 null, 185 null,
186 null, 186 null));
187 []));
188 } 187 }
189 188
190 void test_visitClassDeclaration_extends_implements() { 189 void test_visitClassDeclaration_extends_implements() {
191 _assertClone( 190 _assertClone(
192 AstFactory.classDeclaration( 191 AstFactory.classDeclaration(
193 null, 192 null,
194 "C", 193 "C",
195 null, 194 null,
196 AstFactory.extendsClause(AstFactory.typeName4("A", [])), 195 AstFactory.extendsClause(AstFactory.typeName4("A")),
197 null, 196 null,
198 AstFactory.implementsClause([AstFactory.typeName4("B", [])]), 197 AstFactory.implementsClause([AstFactory.typeName4("B")])));
199 []));
200 } 198 }
201 199
202 void test_visitClassDeclaration_extends_with() { 200 void test_visitClassDeclaration_extends_with() {
203 _assertClone( 201 _assertClone(
204 AstFactory.classDeclaration( 202 AstFactory.classDeclaration(
205 null, 203 null,
206 "C", 204 "C",
207 null, 205 null,
208 AstFactory.extendsClause(AstFactory.typeName4("A", [])), 206 AstFactory.extendsClause(AstFactory.typeName4("A")),
209 AstFactory.withClause([AstFactory.typeName4("M", [])]), 207 AstFactory.withClause([AstFactory.typeName4("M")]),
210 null, 208 null));
211 []));
212 } 209 }
213 210
214 void test_visitClassDeclaration_extends_with_implements() { 211 void test_visitClassDeclaration_extends_with_implements() {
215 _assertClone( 212 _assertClone(
216 AstFactory.classDeclaration( 213 AstFactory.classDeclaration(
217 null, 214 null,
218 "C", 215 "C",
219 null, 216 null,
220 AstFactory.extendsClause(AstFactory.typeName4("A", [])), 217 AstFactory.extendsClause(AstFactory.typeName4("A")),
221 AstFactory.withClause([AstFactory.typeName4("M", [])]), 218 AstFactory.withClause([AstFactory.typeName4("M")]),
222 AstFactory.implementsClause([AstFactory.typeName4("B", [])]), 219 AstFactory.implementsClause([AstFactory.typeName4("B")])));
223 []));
224 } 220 }
225 221
226 void test_visitClassDeclaration_implements() { 222 void test_visitClassDeclaration_implements() {
227 _assertClone( 223 _assertClone(
228 AstFactory.classDeclaration( 224 AstFactory.classDeclaration(
229 null, 225 null,
230 "C", 226 "C",
231 null, 227 null,
232 null, 228 null,
233 null, 229 null,
234 AstFactory.implementsClause([AstFactory.typeName4("B", [])]), 230 AstFactory.implementsClause([AstFactory.typeName4("B")])));
235 []));
236 } 231 }
237 232
238 void test_visitClassDeclaration_multipleMember() { 233 void test_visitClassDeclaration_multipleMember() {
239 _assertClone( 234 _assertClone(
240 AstFactory.classDeclaration( 235 AstFactory.classDeclaration(
241 null, 236 null,
242 "C", 237 "C",
243 null, 238 null,
244 null, 239 null,
245 null, 240 null,
(...skipping 10 matching lines...) Expand all
256 } 251 }
257 252
258 void test_visitClassDeclaration_parameters() { 253 void test_visitClassDeclaration_parameters() {
259 _assertClone( 254 _assertClone(
260 AstFactory.classDeclaration( 255 AstFactory.classDeclaration(
261 null, 256 null,
262 "C", 257 "C",
263 AstFactory.typeParameterList(["E"]), 258 AstFactory.typeParameterList(["E"]),
264 null, 259 null,
265 null, 260 null,
266 null, 261 null));
267 []));
268 } 262 }
269 263
270 void test_visitClassDeclaration_parameters_extends() { 264 void test_visitClassDeclaration_parameters_extends() {
271 _assertClone( 265 _assertClone(
272 AstFactory.classDeclaration( 266 AstFactory.classDeclaration(
273 null, 267 null,
274 "C", 268 "C",
275 AstFactory.typeParameterList(["E"]), 269 AstFactory.typeParameterList(["E"]),
276 AstFactory.extendsClause(AstFactory.typeName4("A", [])), 270 AstFactory.extendsClause(AstFactory.typeName4("A")),
277 null, 271 null,
278 null, 272 null));
279 []));
280 } 273 }
281 274
282 void test_visitClassDeclaration_parameters_extends_implements() { 275 void test_visitClassDeclaration_parameters_extends_implements() {
283 _assertClone( 276 _assertClone(
284 AstFactory.classDeclaration( 277 AstFactory.classDeclaration(
285 null, 278 null,
286 "C", 279 "C",
287 AstFactory.typeParameterList(["E"]), 280 AstFactory.typeParameterList(["E"]),
288 AstFactory.extendsClause(AstFactory.typeName4("A", [])), 281 AstFactory.extendsClause(AstFactory.typeName4("A")),
289 null, 282 null,
290 AstFactory.implementsClause([AstFactory.typeName4("B", [])]), 283 AstFactory.implementsClause([AstFactory.typeName4("B")])));
291 []));
292 } 284 }
293 285
294 void test_visitClassDeclaration_parameters_extends_with() { 286 void test_visitClassDeclaration_parameters_extends_with() {
295 _assertClone( 287 _assertClone(
296 AstFactory.classDeclaration( 288 AstFactory.classDeclaration(
297 null, 289 null,
298 "C", 290 "C",
299 AstFactory.typeParameterList(["E"]), 291 AstFactory.typeParameterList(["E"]),
300 AstFactory.extendsClause(AstFactory.typeName4("A", [])), 292 AstFactory.extendsClause(AstFactory.typeName4("A")),
301 AstFactory.withClause([AstFactory.typeName4("M", [])]), 293 AstFactory.withClause([AstFactory.typeName4("M")]),
302 null, 294 null));
303 []));
304 } 295 }
305 296
306 void test_visitClassDeclaration_parameters_extends_with_implements() { 297 void test_visitClassDeclaration_parameters_extends_with_implements() {
307 _assertClone( 298 _assertClone(
308 AstFactory.classDeclaration( 299 AstFactory.classDeclaration(
309 null, 300 null,
310 "C", 301 "C",
311 AstFactory.typeParameterList(["E"]), 302 AstFactory.typeParameterList(["E"]),
312 AstFactory.extendsClause(AstFactory.typeName4("A", [])), 303 AstFactory.extendsClause(AstFactory.typeName4("A")),
313 AstFactory.withClause([AstFactory.typeName4("M", [])]), 304 AstFactory.withClause([AstFactory.typeName4("M")]),
314 AstFactory.implementsClause([AstFactory.typeName4("B", [])]), 305 AstFactory.implementsClause([AstFactory.typeName4("B")])));
315 []));
316 } 306 }
317 307
318 void test_visitClassDeclaration_parameters_implements() { 308 void test_visitClassDeclaration_parameters_implements() {
319 _assertClone( 309 _assertClone(
320 AstFactory.classDeclaration( 310 AstFactory.classDeclaration(
321 null, 311 null,
322 "C", 312 "C",
323 AstFactory.typeParameterList(["E"]), 313 AstFactory.typeParameterList(["E"]),
324 null, 314 null,
325 null, 315 null,
326 AstFactory.implementsClause([AstFactory.typeName4("B", [])]), 316 AstFactory.implementsClause([AstFactory.typeName4("B")])));
327 []));
328 } 317 }
329 318
330 void test_visitClassDeclaration_singleMember() { 319 void test_visitClassDeclaration_singleMember() {
331 _assertClone( 320 _assertClone(
332 AstFactory.classDeclaration( 321 AstFactory.classDeclaration(
333 null, 322 null,
334 "C", 323 "C",
335 null, 324 null,
336 null, 325 null,
337 null, 326 null,
338 null, 327 null,
339 [ 328 [
340 AstFactory.fieldDeclaration2( 329 AstFactory.fieldDeclaration2(
341 false, 330 false,
342 Keyword.VAR, 331 Keyword.VAR,
343 [AstFactory.variableDeclaration("a")])])); 332 [AstFactory.variableDeclaration("a")])]));
344 } 333 }
345 334
346 void test_visitClassDeclaration_withMetadata() { 335 void test_visitClassDeclaration_withMetadata() {
347 ClassDeclaration declaration = 336 ClassDeclaration declaration =
348 AstFactory.classDeclaration(null, "C", null, null, null, null, []); 337 AstFactory.classDeclaration(null, "C", null, null, null, null);
349 declaration.metadata = 338 declaration.metadata =
350 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 339 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
351 _assertClone(declaration); 340 _assertClone(declaration);
352 } 341 }
353 342
354 void test_visitClassTypeAlias_abstract() { 343 void test_visitClassTypeAlias_abstract() {
355 _assertClone( 344 _assertClone(
356 AstFactory.classTypeAlias( 345 AstFactory.classTypeAlias(
357 "C", 346 "C",
358 null, 347 null,
359 Keyword.ABSTRACT, 348 Keyword.ABSTRACT,
360 AstFactory.typeName4("S", []), 349 AstFactory.typeName4("S"),
361 AstFactory.withClause([AstFactory.typeName4("M1", [])]), 350 AstFactory.withClause([AstFactory.typeName4("M1")]),
362 null)); 351 null));
363 } 352 }
364 353
365 void test_visitClassTypeAlias_abstract_implements() { 354 void test_visitClassTypeAlias_abstract_implements() {
366 _assertClone( 355 _assertClone(
367 AstFactory.classTypeAlias( 356 AstFactory.classTypeAlias(
368 "C", 357 "C",
369 null, 358 null,
370 Keyword.ABSTRACT, 359 Keyword.ABSTRACT,
371 AstFactory.typeName4("S", []), 360 AstFactory.typeName4("S"),
372 AstFactory.withClause([AstFactory.typeName4("M1", [])]), 361 AstFactory.withClause([AstFactory.typeName4("M1")]),
373 AstFactory.implementsClause([AstFactory.typeName4("I", [])]))); 362 AstFactory.implementsClause([AstFactory.typeName4("I")])));
374 } 363 }
375 364
376 void test_visitClassTypeAlias_generic() { 365 void test_visitClassTypeAlias_generic() {
377 _assertClone( 366 _assertClone(
378 AstFactory.classTypeAlias( 367 AstFactory.classTypeAlias(
379 "C", 368 "C",
380 AstFactory.typeParameterList(["E"]), 369 AstFactory.typeParameterList(["E"]),
381 null, 370 null,
382 AstFactory.typeName4("S", [AstFactory.typeName4("E", [])]), 371 AstFactory.typeName4("S", [AstFactory.typeName4("E")]),
383 AstFactory.withClause( 372 AstFactory.withClause(
384 [AstFactory.typeName4("M1", [AstFactory.typeName4("E", [])])]), 373 [AstFactory.typeName4("M1", [AstFactory.typeName4("E")])]),
385 null)); 374 null));
386 } 375 }
387 376
388 void test_visitClassTypeAlias_implements() { 377 void test_visitClassTypeAlias_implements() {
389 _assertClone( 378 _assertClone(
390 AstFactory.classTypeAlias( 379 AstFactory.classTypeAlias(
391 "C", 380 "C",
392 null, 381 null,
393 null, 382 null,
394 AstFactory.typeName4("S", []), 383 AstFactory.typeName4("S"),
395 AstFactory.withClause([AstFactory.typeName4("M1", [])]), 384 AstFactory.withClause([AstFactory.typeName4("M1")]),
396 AstFactory.implementsClause([AstFactory.typeName4("I", [])]))); 385 AstFactory.implementsClause([AstFactory.typeName4("I")])));
397 } 386 }
398 387
399 void test_visitClassTypeAlias_minimal() { 388 void test_visitClassTypeAlias_minimal() {
400 _assertClone( 389 _assertClone(
401 AstFactory.classTypeAlias( 390 AstFactory.classTypeAlias(
402 "C", 391 "C",
403 null, 392 null,
404 null, 393 null,
405 AstFactory.typeName4("S", []), 394 AstFactory.typeName4("S"),
406 AstFactory.withClause([AstFactory.typeName4("M1", [])]), 395 AstFactory.withClause([AstFactory.typeName4("M1")]),
407 null)); 396 null));
408 } 397 }
409 398
410 void test_visitClassTypeAlias_parameters_abstract() { 399 void test_visitClassTypeAlias_parameters_abstract() {
411 _assertClone( 400 _assertClone(
412 AstFactory.classTypeAlias( 401 AstFactory.classTypeAlias(
413 "C", 402 "C",
414 AstFactory.typeParameterList(["E"]), 403 AstFactory.typeParameterList(["E"]),
415 Keyword.ABSTRACT, 404 Keyword.ABSTRACT,
416 AstFactory.typeName4("S", []), 405 AstFactory.typeName4("S"),
417 AstFactory.withClause([AstFactory.typeName4("M1", [])]), 406 AstFactory.withClause([AstFactory.typeName4("M1")]),
418 null)); 407 null));
419 } 408 }
420 409
421 void test_visitClassTypeAlias_parameters_abstract_implements() { 410 void test_visitClassTypeAlias_parameters_abstract_implements() {
422 _assertClone( 411 _assertClone(
423 AstFactory.classTypeAlias( 412 AstFactory.classTypeAlias(
424 "C", 413 "C",
425 AstFactory.typeParameterList(["E"]), 414 AstFactory.typeParameterList(["E"]),
426 Keyword.ABSTRACT, 415 Keyword.ABSTRACT,
427 AstFactory.typeName4("S", []), 416 AstFactory.typeName4("S"),
428 AstFactory.withClause([AstFactory.typeName4("M1", [])]), 417 AstFactory.withClause([AstFactory.typeName4("M1")]),
429 AstFactory.implementsClause([AstFactory.typeName4("I", [])]))); 418 AstFactory.implementsClause([AstFactory.typeName4("I")])));
430 } 419 }
431 420
432 void test_visitClassTypeAlias_parameters_implements() { 421 void test_visitClassTypeAlias_parameters_implements() {
433 _assertClone( 422 _assertClone(
434 AstFactory.classTypeAlias( 423 AstFactory.classTypeAlias(
435 "C", 424 "C",
436 AstFactory.typeParameterList(["E"]), 425 AstFactory.typeParameterList(["E"]),
437 null, 426 null,
438 AstFactory.typeName4("S", []), 427 AstFactory.typeName4("S"),
439 AstFactory.withClause([AstFactory.typeName4("M1", [])]), 428 AstFactory.withClause([AstFactory.typeName4("M1")]),
440 AstFactory.implementsClause([AstFactory.typeName4("I", [])]))); 429 AstFactory.implementsClause([AstFactory.typeName4("I")])));
441 } 430 }
442 431
443 void test_visitClassTypeAlias_withMetadata() { 432 void test_visitClassTypeAlias_withMetadata() {
444 ClassTypeAlias declaration = AstFactory.classTypeAlias( 433 ClassTypeAlias declaration = AstFactory.classTypeAlias(
445 "C", 434 "C",
446 null, 435 null,
447 null, 436 null,
448 AstFactory.typeName4("S", []), 437 AstFactory.typeName4("S"),
449 AstFactory.withClause([AstFactory.typeName4("M1", [])]), 438 AstFactory.withClause([AstFactory.typeName4("M1")]),
450 null); 439 null);
451 declaration.metadata = 440 declaration.metadata =
452 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 441 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
453 _assertClone(declaration); 442 _assertClone(declaration);
454 } 443 }
455 444
456 void test_visitComment() { 445 void test_visitComment() {
457 _assertClone( 446 _assertClone(
458 Comment.createBlockComment( 447 Comment.createBlockComment(
459 <Token>[TokenFactory.tokenFromString("/* comment */")])); 448 <Token>[TokenFactory.tokenFromString("/* comment */")]));
460 } 449 }
461 450
462 void test_visitCommentReference() { 451 void test_visitCommentReference() {
(...skipping 10 matching lines...) Expand all
473 } 462 }
474 463
475 void test_visitCompilationUnit_directive() { 464 void test_visitCompilationUnit_directive() {
476 _assertClone( 465 _assertClone(
477 AstFactory.compilationUnit3([AstFactory.libraryDirective2("l")])); 466 AstFactory.compilationUnit3([AstFactory.libraryDirective2("l")]));
478 } 467 }
479 468
480 void test_visitCompilationUnit_directive_declaration() { 469 void test_visitCompilationUnit_directive_declaration() {
481 _assertClone( 470 _assertClone(
482 AstFactory.compilationUnit4( 471 AstFactory.compilationUnit4(
483 AstFactory.list([AstFactory.libraryDirective2("l")]), 472 [AstFactory.libraryDirective2("l")],
484 AstFactory.list( 473 [AstFactory.topLevelVariableDeclaration2(
485 [ 474 Keyword.VAR,
486 AstFactory.topLevelVariableDeclaration2( 475 [AstFactory.variableDeclaration("a")])]));
487 Keyword.VAR,
488 [AstFactory.variableDeclaration("a")])])));
489 } 476 }
490 477
491 void test_visitCompilationUnit_empty() { 478 void test_visitCompilationUnit_empty() {
492 _assertClone(AstFactory.compilationUnit()); 479 _assertClone(AstFactory.compilationUnit());
493 } 480 }
494 481
495 void test_visitCompilationUnit_script() { 482 void test_visitCompilationUnit_script() {
496 _assertClone(AstFactory.compilationUnit5("!#/bin/dartvm")); 483 _assertClone(AstFactory.compilationUnit5("!#/bin/dartvm"));
497 } 484 }
498 485
(...skipping 11 matching lines...) Expand all
510 _assertClone( 497 _assertClone(
511 AstFactory.compilationUnit7( 498 AstFactory.compilationUnit7(
512 "!#/bin/dartvm", 499 "!#/bin/dartvm",
513 [AstFactory.libraryDirective2("l")])); 500 [AstFactory.libraryDirective2("l")]));
514 } 501 }
515 502
516 void test_visitCompilationUnit_script_directives_declarations() { 503 void test_visitCompilationUnit_script_directives_declarations() {
517 _assertClone( 504 _assertClone(
518 AstFactory.compilationUnit8( 505 AstFactory.compilationUnit8(
519 "!#/bin/dartvm", 506 "!#/bin/dartvm",
520 AstFactory.list([AstFactory.libraryDirective2("l")]), 507 [AstFactory.libraryDirective2("l")],
521 AstFactory.list( 508 [AstFactory.topLevelVariableDeclaration2(
522 [ 509 Keyword.VAR,
523 AstFactory.topLevelVariableDeclaration2( 510 [AstFactory.variableDeclaration("a")])]));
524 Keyword.VAR,
525 [AstFactory.variableDeclaration("a")])])));
526 } 511 }
527 512
528 void test_visitConditionalExpression() { 513 void test_visitConditionalExpression() {
529 _assertClone( 514 _assertClone(
530 AstFactory.conditionalExpression( 515 AstFactory.conditionalExpression(
531 AstFactory.identifier3("a"), 516 AstFactory.identifier3("a"),
532 AstFactory.identifier3("b"), 517 AstFactory.identifier3("b"),
533 AstFactory.identifier3("c"))); 518 AstFactory.identifier3("c")));
534 } 519 }
535 520
536 void test_visitConstructorDeclaration_const() { 521 void test_visitConstructorDeclaration_const() {
537 _assertClone( 522 _assertClone(
538 AstFactory.constructorDeclaration2( 523 AstFactory.constructorDeclaration2(
539 Keyword.CONST, 524 Keyword.CONST,
540 null, 525 null,
541 AstFactory.identifier3("C"), 526 AstFactory.identifier3("C"),
542 null, 527 null,
543 AstFactory.formalParameterList([]), 528 AstFactory.formalParameterList(),
544 null, 529 null,
545 AstFactory.blockFunctionBody2([]))); 530 AstFactory.blockFunctionBody2()));
546 } 531 }
547 532
548 void test_visitConstructorDeclaration_external() { 533 void test_visitConstructorDeclaration_external() {
549 _assertClone( 534 _assertClone(
550 AstFactory.constructorDeclaration( 535 AstFactory.constructorDeclaration(
551 AstFactory.identifier3("C"), 536 AstFactory.identifier3("C"),
552 null, 537 null,
553 AstFactory.formalParameterList([]), 538 AstFactory.formalParameterList(),
554 null)); 539 null));
555 } 540 }
556 541
557 void test_visitConstructorDeclaration_minimal() { 542 void test_visitConstructorDeclaration_minimal() {
558 _assertClone( 543 _assertClone(
559 AstFactory.constructorDeclaration2( 544 AstFactory.constructorDeclaration2(
560 null, 545 null,
561 null, 546 null,
562 AstFactory.identifier3("C"), 547 AstFactory.identifier3("C"),
563 null, 548 null,
564 AstFactory.formalParameterList([]), 549 AstFactory.formalParameterList(),
565 null, 550 null,
566 AstFactory.blockFunctionBody2([]))); 551 AstFactory.blockFunctionBody2()));
567 } 552 }
568 553
569 void test_visitConstructorDeclaration_multipleInitializers() { 554 void test_visitConstructorDeclaration_multipleInitializers() {
570 _assertClone( 555 _assertClone(
571 AstFactory.constructorDeclaration2( 556 AstFactory.constructorDeclaration2(
572 null, 557 null,
573 null, 558 null,
574 AstFactory.identifier3("C"), 559 AstFactory.identifier3("C"),
575 null, 560 null,
576 AstFactory.formalParameterList([]), 561 AstFactory.formalParameterList(),
577 AstFactory.list( 562 [AstFactory.constructorFieldInitializer(false, "a", AstFactory.ident ifier3("b")),
578 [ 563 AstFactory.constructorFieldInitializer(
579 AstFactory.constructorFieldInitializer(false, "a", AstFactor y.identifier3("b")), 564 false,
580 AstFactory.constructorFieldInitializer( 565 "c",
581 false, 566 AstFactory.identifier3("d"))],
582 "c", 567 AstFactory.blockFunctionBody2()));
583 AstFactory.identifier3("d"))]),
584 AstFactory.blockFunctionBody2([])));
585 } 568 }
586 569
587 void test_visitConstructorDeclaration_multipleParameters() { 570 void test_visitConstructorDeclaration_multipleParameters() {
588 _assertClone( 571 _assertClone(
589 AstFactory.constructorDeclaration2( 572 AstFactory.constructorDeclaration2(
590 null, 573 null,
591 null, 574 null,
592 AstFactory.identifier3("C"), 575 AstFactory.identifier3("C"),
593 null, 576 null,
594 AstFactory.formalParameterList( 577 AstFactory.formalParameterList([
595 [ 578 AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
596 AstFactory.simpleFormalParameter(Keyword.VAR, "a"), 579 AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
597 AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
598 null, 580 null,
599 AstFactory.blockFunctionBody2([]))); 581 AstFactory.blockFunctionBody2()));
600 } 582 }
601 583
602 void test_visitConstructorDeclaration_named() { 584 void test_visitConstructorDeclaration_named() {
603 _assertClone( 585 _assertClone(
604 AstFactory.constructorDeclaration2( 586 AstFactory.constructorDeclaration2(
605 null, 587 null,
606 null, 588 null,
607 AstFactory.identifier3("C"), 589 AstFactory.identifier3("C"),
608 "m", 590 "m",
609 AstFactory.formalParameterList([]), 591 AstFactory.formalParameterList(),
610 null, 592 null,
611 AstFactory.blockFunctionBody2([]))); 593 AstFactory.blockFunctionBody2()));
612 } 594 }
613 595
614 void test_visitConstructorDeclaration_singleInitializer() { 596 void test_visitConstructorDeclaration_singleInitializer() {
615 _assertClone( 597 _assertClone(
616 AstFactory.constructorDeclaration2( 598 AstFactory.constructorDeclaration2(
617 null, 599 null,
618 null, 600 null,
619 AstFactory.identifier3("C"), 601 AstFactory.identifier3("C"),
620 null, 602 null,
621 AstFactory.formalParameterList([]), 603 AstFactory.formalParameterList(),
622 AstFactory.list( 604 [AstFactory.constructorFieldInitializer(
623 [ 605 false,
624 AstFactory.constructorFieldInitializer( 606 "a",
625 false, 607 AstFactory.identifier3("b"))],
626 "a", 608 AstFactory.blockFunctionBody2()));
627 AstFactory.identifier3("b"))]),
628 AstFactory.blockFunctionBody2([])));
629 } 609 }
630 610
631 void test_visitConstructorDeclaration_withMetadata() { 611 void test_visitConstructorDeclaration_withMetadata() {
632 ConstructorDeclaration declaration = AstFactory.constructorDeclaration2( 612 ConstructorDeclaration declaration = AstFactory.constructorDeclaration2(
633 null, 613 null,
634 null, 614 null,
635 AstFactory.identifier3("C"), 615 AstFactory.identifier3("C"),
636 null, 616 null,
637 AstFactory.formalParameterList([]), 617 AstFactory.formalParameterList(),
638 null, 618 null,
639 AstFactory.blockFunctionBody2([])); 619 AstFactory.blockFunctionBody2());
640 declaration.metadata = 620 declaration.metadata =
641 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 621 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
642 _assertClone(declaration); 622 _assertClone(declaration);
643 } 623 }
644 624
645 void test_visitConstructorFieldInitializer_withThis() { 625 void test_visitConstructorFieldInitializer_withThis() {
646 _assertClone( 626 _assertClone(
647 AstFactory.constructorFieldInitializer(true, "a", AstFactory.identifier3 ("b"))); 627 AstFactory.constructorFieldInitializer(true, "a", AstFactory.identifier3 ("b")));
648 } 628 }
649 629
650 void test_visitConstructorFieldInitializer_withoutThis() { 630 void test_visitConstructorFieldInitializer_withoutThis() {
651 _assertClone( 631 _assertClone(
652 AstFactory.constructorFieldInitializer( 632 AstFactory.constructorFieldInitializer(
653 false, 633 false,
654 "a", 634 "a",
655 AstFactory.identifier3("b"))); 635 AstFactory.identifier3("b")));
656 } 636 }
657 637
658 void test_visitConstructorName_named_prefix() { 638 void test_visitConstructorName_named_prefix() {
659 _assertClone( 639 _assertClone(
660 AstFactory.constructorName(AstFactory.typeName4("p.C.n", []), null)); 640 AstFactory.constructorName(AstFactory.typeName4("p.C.n"), null));
661 } 641 }
662 642
663 void test_visitConstructorName_unnamed_noPrefix() { 643 void test_visitConstructorName_unnamed_noPrefix() {
664 _assertClone( 644 _assertClone(
665 AstFactory.constructorName(AstFactory.typeName4("C", []), null)); 645 AstFactory.constructorName(AstFactory.typeName4("C"), null));
666 } 646 }
667 647
668 void test_visitConstructorName_unnamed_prefix() { 648 void test_visitConstructorName_unnamed_prefix() {
669 _assertClone( 649 _assertClone(
670 AstFactory.constructorName( 650 AstFactory.constructorName(
671 AstFactory.typeName3(AstFactory.identifier5("p", "C"), []), 651 AstFactory.typeName3(AstFactory.identifier5("p", "C")),
672 null)); 652 null));
673 } 653 }
674 654
675 void test_visitContinueStatement_label() { 655 void test_visitContinueStatement_label() {
676 _assertClone(AstFactory.continueStatement("l")); 656 _assertClone(AstFactory.continueStatement("l"));
677 } 657 }
678 658
679 void test_visitContinueStatement_noLabel() { 659 void test_visitContinueStatement_noLabel() {
680 _assertClone(AstFactory.continueStatement()); 660 _assertClone(AstFactory.continueStatement());
681 } 661 }
(...skipping 19 matching lines...) Expand all
701 681
702 void test_visitDefaultFormalParameter_positional_value() { 682 void test_visitDefaultFormalParameter_positional_value() {
703 _assertClone( 683 _assertClone(
704 AstFactory.positionalFormalParameter( 684 AstFactory.positionalFormalParameter(
705 AstFactory.simpleFormalParameter3("p"), 685 AstFactory.simpleFormalParameter3("p"),
706 AstFactory.integer(0))); 686 AstFactory.integer(0)));
707 } 687 }
708 688
709 void test_visitDoStatement() { 689 void test_visitDoStatement() {
710 _assertClone( 690 _assertClone(
711 AstFactory.doStatement(AstFactory.block([]), AstFactory.identifier3("c") )); 691 AstFactory.doStatement(AstFactory.block(), AstFactory.identifier3("c"))) ;
712 } 692 }
713 693
714 void test_visitDoubleLiteral() { 694 void test_visitDoubleLiteral() {
715 _assertClone(AstFactory.doubleLiteral(4.2)); 695 _assertClone(AstFactory.doubleLiteral(4.2));
716 } 696 }
717 697
718 void test_visitEmptyFunctionBody() { 698 void test_visitEmptyFunctionBody() {
719 _assertClone(AstFactory.emptyFunctionBody()); 699 _assertClone(AstFactory.emptyFunctionBody());
720 } 700 }
721 701
(...skipping 11 matching lines...) Expand all
733 void test_visitExportDirective_combinators() { 713 void test_visitExportDirective_combinators() {
734 _assertClone( 714 _assertClone(
735 AstFactory.exportDirective2( 715 AstFactory.exportDirective2(
736 "a.dart", 716 "a.dart",
737 [ 717 [
738 AstFactory.showCombinator([AstFactory.identifier3("A")]), 718 AstFactory.showCombinator([AstFactory.identifier3("A")]),
739 AstFactory.hideCombinator([AstFactory.identifier3("B")])])); 719 AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
740 } 720 }
741 721
742 void test_visitExportDirective_minimal() { 722 void test_visitExportDirective_minimal() {
743 _assertClone(AstFactory.exportDirective2("a.dart", [])); 723 _assertClone(AstFactory.exportDirective2("a.dart"));
744 } 724 }
745 725
746 void test_visitExportDirective_withMetadata() { 726 void test_visitExportDirective_withMetadata() {
747 ExportDirective directive = AstFactory.exportDirective2("a.dart", []); 727 ExportDirective directive = AstFactory.exportDirective2("a.dart");
748 directive.metadata = 728 directive.metadata =
749 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 729 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
750 _assertClone(directive); 730 _assertClone(directive);
751 } 731 }
752 732
753 void test_visitExpressionFunctionBody() { 733 void test_visitExpressionFunctionBody() {
754 _assertClone( 734 _assertClone(
755 AstFactory.expressionFunctionBody(AstFactory.identifier3("a"))); 735 AstFactory.expressionFunctionBody(AstFactory.identifier3("a")));
756 } 736 }
757 737
758 void test_visitExpressionStatement() { 738 void test_visitExpressionStatement() {
759 _assertClone(AstFactory.expressionStatement(AstFactory.identifier3("a"))); 739 _assertClone(AstFactory.expressionStatement(AstFactory.identifier3("a")));
760 } 740 }
761 741
762 void test_visitExtendsClause() { 742 void test_visitExtendsClause() {
763 _assertClone(AstFactory.extendsClause(AstFactory.typeName4("C", []))); 743 _assertClone(AstFactory.extendsClause(AstFactory.typeName4("C")));
764 } 744 }
765 745
766 void test_visitFieldDeclaration_instance() { 746 void test_visitFieldDeclaration_instance() {
767 _assertClone( 747 _assertClone(
768 AstFactory.fieldDeclaration2( 748 AstFactory.fieldDeclaration2(
769 false, 749 false,
770 Keyword.VAR, 750 Keyword.VAR,
771 [AstFactory.variableDeclaration("a")])); 751 [AstFactory.variableDeclaration("a")]));
772 } 752 }
773 753
774 void test_visitFieldDeclaration_static() { 754 void test_visitFieldDeclaration_static() {
775 _assertClone( 755 _assertClone(
776 AstFactory.fieldDeclaration2( 756 AstFactory.fieldDeclaration2(
777 true, 757 true,
778 Keyword.VAR, 758 Keyword.VAR,
779 [AstFactory.variableDeclaration("a")])); 759 [AstFactory.variableDeclaration("a")]));
780 } 760 }
781 761
782 void test_visitFieldDeclaration_withMetadata() { 762 void test_visitFieldDeclaration_withMetadata() {
783 FieldDeclaration declaration = AstFactory.fieldDeclaration2( 763 FieldDeclaration declaration = AstFactory.fieldDeclaration2(
784 false, 764 false,
785 Keyword.VAR, 765 Keyword.VAR,
786 [AstFactory.variableDeclaration("a")]); 766 [AstFactory.variableDeclaration("a")]);
787 declaration.metadata = 767 declaration.metadata =
788 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 768 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
789 _assertClone(declaration); 769 _assertClone(declaration);
790 } 770 }
791 771
792 void test_visitFieldFormalParameter_functionTyped() { 772 void test_visitFieldFormalParameter_functionTyped() {
793 _assertClone( 773 _assertClone(
794 AstFactory.fieldFormalParameter( 774 AstFactory.fieldFormalParameter(
795 null, 775 null,
796 AstFactory.typeName4("A", []), 776 AstFactory.typeName4("A"),
797 "a", 777 "a",
798 AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("b ")]))); 778 AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("b ")])));
799 } 779 }
800 780
801 void test_visitFieldFormalParameter_keyword() { 781 void test_visitFieldFormalParameter_keyword() {
802 _assertClone(AstFactory.fieldFormalParameter(Keyword.VAR, null, "a")); 782 _assertClone(AstFactory.fieldFormalParameter(Keyword.VAR, null, "a"));
803 } 783 }
804 784
805 void test_visitFieldFormalParameter_keywordAndType() { 785 void test_visitFieldFormalParameter_keywordAndType() {
806 _assertClone( 786 _assertClone(
807 AstFactory.fieldFormalParameter( 787 AstFactory.fieldFormalParameter(
808 Keyword.FINAL, 788 Keyword.FINAL,
809 AstFactory.typeName4("A", []), 789 AstFactory.typeName4("A"),
810 "a")); 790 "a"));
811 } 791 }
812 792
813 void test_visitFieldFormalParameter_type() { 793 void test_visitFieldFormalParameter_type() {
814 _assertClone( 794 _assertClone(
815 AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A", []), "a" )); 795 AstFactory.fieldFormalParameter(null, AstFactory.typeName4("A"), "a"));
816 } 796 }
817 797
818 void test_visitForEachStatement_declared() { 798 void test_visitForEachStatement_declared() {
819 _assertClone( 799 _assertClone(
820 AstFactory.forEachStatement( 800 AstFactory.forEachStatement(
821 AstFactory.declaredIdentifier3("a"), 801 AstFactory.declaredIdentifier3("a"),
822 AstFactory.identifier3("b"), 802 AstFactory.identifier3("b"),
823 AstFactory.block([]))); 803 AstFactory.block()));
824 } 804 }
825 805
826 void test_visitForEachStatement_variable() { 806 void test_visitForEachStatement_variable() {
827 _assertClone( 807 _assertClone(
828 new ForEachStatement.con2( 808 new ForEachStatement.con2(
829 null, 809 null,
830 TokenFactory.tokenFromKeyword(Keyword.FOR), 810 TokenFactory.tokenFromKeyword(Keyword.FOR),
831 TokenFactory.tokenFromType(TokenType.OPEN_PAREN), 811 TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
832 AstFactory.identifier3("a"), 812 AstFactory.identifier3("a"),
833 TokenFactory.tokenFromKeyword(Keyword.IN), 813 TokenFactory.tokenFromKeyword(Keyword.IN),
834 AstFactory.identifier3("b"), 814 AstFactory.identifier3("b"),
835 TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), 815 TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
836 AstFactory.block([]))); 816 AstFactory.block()));
837 } 817 }
838 818
839 void test_visitForEachStatement_variable_await() { 819 void test_visitForEachStatement_variable_await() {
840 _assertClone( 820 _assertClone(
841 new ForEachStatement.con2( 821 new ForEachStatement.con2(
842 TokenFactory.tokenFromString("await"), 822 TokenFactory.tokenFromString("await"),
843 TokenFactory.tokenFromKeyword(Keyword.FOR), 823 TokenFactory.tokenFromKeyword(Keyword.FOR),
844 TokenFactory.tokenFromType(TokenType.OPEN_PAREN), 824 TokenFactory.tokenFromType(TokenType.OPEN_PAREN),
845 AstFactory.identifier3("a"), 825 AstFactory.identifier3("a"),
846 TokenFactory.tokenFromKeyword(Keyword.IN), 826 TokenFactory.tokenFromKeyword(Keyword.IN),
847 AstFactory.identifier3("b"), 827 AstFactory.identifier3("b"),
848 TokenFactory.tokenFromType(TokenType.CLOSE_PAREN), 828 TokenFactory.tokenFromType(TokenType.CLOSE_PAREN),
849 AstFactory.block([]))); 829 AstFactory.block()));
850 } 830 }
851 831
852 void test_visitForStatement_c() { 832 void test_visitForStatement_c() {
853 _assertClone( 833 _assertClone(
854 AstFactory.forStatement( 834 AstFactory.forStatement(
855 null, 835 null,
856 AstFactory.identifier3("c"), 836 AstFactory.identifier3("c"),
857 null, 837 null,
858 AstFactory.block([]))); 838 AstFactory.block()));
859 } 839 }
860 840
861 void test_visitForStatement_cu() { 841 void test_visitForStatement_cu() {
862 _assertClone( 842 _assertClone(
863 AstFactory.forStatement( 843 AstFactory.forStatement(
864 null, 844 null,
865 AstFactory.identifier3("c"), 845 AstFactory.identifier3("c"),
866 AstFactory.list([AstFactory.identifier3("u")]), 846 [AstFactory.identifier3("u")],
867 AstFactory.block([]))); 847 AstFactory.block()));
868 } 848 }
869 849
870 void test_visitForStatement_e() { 850 void test_visitForStatement_e() {
871 _assertClone( 851 _assertClone(
872 AstFactory.forStatement( 852 AstFactory.forStatement(
873 AstFactory.identifier3("e"), 853 AstFactory.identifier3("e"),
874 null, 854 null,
875 null, 855 null,
876 AstFactory.block([]))); 856 AstFactory.block()));
877 } 857 }
878 858
879 void test_visitForStatement_ec() { 859 void test_visitForStatement_ec() {
880 _assertClone( 860 _assertClone(
881 AstFactory.forStatement( 861 AstFactory.forStatement(
882 AstFactory.identifier3("e"), 862 AstFactory.identifier3("e"),
883 AstFactory.identifier3("c"), 863 AstFactory.identifier3("c"),
884 null, 864 null,
885 AstFactory.block([]))); 865 AstFactory.block()));
886 } 866 }
887 867
888 void test_visitForStatement_ecu() { 868 void test_visitForStatement_ecu() {
889 _assertClone( 869 _assertClone(
890 AstFactory.forStatement( 870 AstFactory.forStatement(
891 AstFactory.identifier3("e"), 871 AstFactory.identifier3("e"),
892 AstFactory.identifier3("c"), 872 AstFactory.identifier3("c"),
893 AstFactory.list([AstFactory.identifier3("u")]), 873 [AstFactory.identifier3("u")],
894 AstFactory.block([]))); 874 AstFactory.block()));
895 } 875 }
896 876
897 void test_visitForStatement_eu() { 877 void test_visitForStatement_eu() {
898 _assertClone( 878 _assertClone(
899 AstFactory.forStatement( 879 AstFactory.forStatement(
900 AstFactory.identifier3("e"), 880 AstFactory.identifier3("e"),
901 null, 881 null,
902 AstFactory.list([AstFactory.identifier3("u")]), 882 [AstFactory.identifier3("u")],
903 AstFactory.block([]))); 883 AstFactory.block()));
904 } 884 }
905 885
906 void test_visitForStatement_i() { 886 void test_visitForStatement_i() {
907 _assertClone( 887 _assertClone(
908 AstFactory.forStatement2( 888 AstFactory.forStatement2(
909 AstFactory.variableDeclarationList2( 889 AstFactory.variableDeclarationList2(
910 Keyword.VAR, 890 Keyword.VAR,
911 [AstFactory.variableDeclaration("i")]), 891 [AstFactory.variableDeclaration("i")]),
912 null, 892 null,
913 null, 893 null,
914 AstFactory.block([]))); 894 AstFactory.block()));
915 } 895 }
916 896
917 void test_visitForStatement_ic() { 897 void test_visitForStatement_ic() {
918 _assertClone( 898 _assertClone(
919 AstFactory.forStatement2( 899 AstFactory.forStatement2(
920 AstFactory.variableDeclarationList2( 900 AstFactory.variableDeclarationList2(
921 Keyword.VAR, 901 Keyword.VAR,
922 [AstFactory.variableDeclaration("i")]), 902 [AstFactory.variableDeclaration("i")]),
923 AstFactory.identifier3("c"), 903 AstFactory.identifier3("c"),
924 null, 904 null,
925 AstFactory.block([]))); 905 AstFactory.block()));
926 } 906 }
927 907
928 void test_visitForStatement_icu() { 908 void test_visitForStatement_icu() {
929 _assertClone( 909 _assertClone(
930 AstFactory.forStatement2( 910 AstFactory.forStatement2(
931 AstFactory.variableDeclarationList2( 911 AstFactory.variableDeclarationList2(
932 Keyword.VAR, 912 Keyword.VAR,
933 [AstFactory.variableDeclaration("i")]), 913 [AstFactory.variableDeclaration("i")]),
934 AstFactory.identifier3("c"), 914 AstFactory.identifier3("c"),
935 AstFactory.list([AstFactory.identifier3("u")]), 915 [AstFactory.identifier3("u")],
936 AstFactory.block([]))); 916 AstFactory.block()));
937 } 917 }
938 918
939 void test_visitForStatement_iu() { 919 void test_visitForStatement_iu() {
940 _assertClone( 920 _assertClone(
941 AstFactory.forStatement2( 921 AstFactory.forStatement2(
942 AstFactory.variableDeclarationList2( 922 AstFactory.variableDeclarationList2(
943 Keyword.VAR, 923 Keyword.VAR,
944 [AstFactory.variableDeclaration("i")]), 924 [AstFactory.variableDeclaration("i")]),
945 null, 925 null,
946 AstFactory.list([AstFactory.identifier3("u")]), 926 [AstFactory.identifier3("u")],
947 AstFactory.block([]))); 927 AstFactory.block()));
948 } 928 }
949 929
950 void test_visitForStatement_u() { 930 void test_visitForStatement_u() {
951 _assertClone( 931 _assertClone(
952 AstFactory.forStatement( 932 AstFactory.forStatement(
953 null, 933 null,
954 null, 934 null,
955 AstFactory.list([AstFactory.identifier3("u")]), 935 [AstFactory.identifier3("u")],
956 AstFactory.block([]))); 936 AstFactory.block()));
957 } 937 }
958 938
959 void test_visitFormalParameterList_empty() { 939 void test_visitFormalParameterList_empty() {
960 _assertClone(AstFactory.formalParameterList([])); 940 _assertClone(AstFactory.formalParameterList());
961 } 941 }
962 942
963 void test_visitFormalParameterList_n() { 943 void test_visitFormalParameterList_n() {
964 _assertClone( 944 _assertClone(
965 AstFactory.formalParameterList( 945 AstFactory.formalParameterList(
966 [ 946 [
967 AstFactory.namedFormalParameter( 947 AstFactory.namedFormalParameter(
968 AstFactory.simpleFormalParameter3("a"), 948 AstFactory.simpleFormalParameter3("a"),
969 AstFactory.integer(0))])); 949 AstFactory.integer(0))]));
970 } 950 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 AstFactory.functionExpression())); 1127 AstFactory.functionExpression()));
1148 } 1128 }
1149 1129
1150 void test_visitFunctionDeclaration_withMetadata() { 1130 void test_visitFunctionDeclaration_withMetadata() {
1151 FunctionDeclaration declaration = AstFactory.functionDeclaration( 1131 FunctionDeclaration declaration = AstFactory.functionDeclaration(
1152 null, 1132 null,
1153 null, 1133 null,
1154 "f", 1134 "f",
1155 AstFactory.functionExpression()); 1135 AstFactory.functionExpression());
1156 declaration.metadata = 1136 declaration.metadata =
1157 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1137 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1158 _assertClone(declaration); 1138 _assertClone(declaration);
1159 } 1139 }
1160 1140
1161 void test_visitFunctionExpression() { 1141 void test_visitFunctionExpression() {
1162 _assertClone(AstFactory.functionExpression()); 1142 _assertClone(AstFactory.functionExpression());
1163 } 1143 }
1164 1144
1165 void test_visitFunctionExpressionInvocation() { 1145 void test_visitFunctionExpressionInvocation() {
1166 _assertClone( 1146 _assertClone(
1167 AstFactory.functionExpressionInvocation(AstFactory.identifier3("f"), []) ); 1147 AstFactory.functionExpressionInvocation(AstFactory.identifier3("f")));
1168 } 1148 }
1169 1149
1170 void test_visitFunctionTypeAlias_generic() { 1150 void test_visitFunctionTypeAlias_generic() {
1171 _assertClone( 1151 _assertClone(
1172 AstFactory.typeAlias( 1152 AstFactory.typeAlias(
1173 AstFactory.typeName4("A", []), 1153 AstFactory.typeName4("A"),
1174 "F", 1154 "F",
1175 AstFactory.typeParameterList(["B"]), 1155 AstFactory.typeParameterList(["B"]),
1176 AstFactory.formalParameterList([]))); 1156 AstFactory.formalParameterList()));
1177 } 1157 }
1178 1158
1179 void test_visitFunctionTypeAlias_nonGeneric() { 1159 void test_visitFunctionTypeAlias_nonGeneric() {
1180 _assertClone( 1160 _assertClone(
1181 AstFactory.typeAlias( 1161 AstFactory.typeAlias(
1182 AstFactory.typeName4("A", []), 1162 AstFactory.typeName4("A"),
1183 "F", 1163 "F",
1184 null, 1164 null,
1185 AstFactory.formalParameterList([]))); 1165 AstFactory.formalParameterList()));
1186 } 1166 }
1187 1167
1188 void test_visitFunctionTypeAlias_withMetadata() { 1168 void test_visitFunctionTypeAlias_withMetadata() {
1189 FunctionTypeAlias declaration = AstFactory.typeAlias( 1169 FunctionTypeAlias declaration = AstFactory.typeAlias(
1190 AstFactory.typeName4("A", []), 1170 AstFactory.typeName4("A"),
1191 "F", 1171 "F",
1192 null, 1172 null,
1193 AstFactory.formalParameterList([])); 1173 AstFactory.formalParameterList());
1194 declaration.metadata = 1174 declaration.metadata =
1195 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1175 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1196 _assertClone(declaration); 1176 _assertClone(declaration);
1197 } 1177 }
1198 1178
1199 void test_visitFunctionTypedFormalParameter_noType() { 1179 void test_visitFunctionTypedFormalParameter_noType() {
1200 _assertClone(AstFactory.functionTypedFormalParameter(null, "f", [])); 1180 _assertClone(AstFactory.functionTypedFormalParameter(null, "f"));
1201 } 1181 }
1202 1182
1203 void test_visitFunctionTypedFormalParameter_type() { 1183 void test_visitFunctionTypedFormalParameter_type() {
1204 _assertClone( 1184 _assertClone(
1205 AstFactory.functionTypedFormalParameter( 1185 AstFactory.functionTypedFormalParameter(
1206 AstFactory.typeName4("T", []), 1186 AstFactory.typeName4("T"),
1207 "f", 1187 "f"));
1208 []));
1209 } 1188 }
1210 1189
1211 void test_visitIfStatement_withElse() { 1190 void test_visitIfStatement_withElse() {
1212 _assertClone( 1191 _assertClone(
1213 AstFactory.ifStatement2( 1192 AstFactory.ifStatement2(
1214 AstFactory.identifier3("c"), 1193 AstFactory.identifier3("c"),
1215 AstFactory.block([]), 1194 AstFactory.block(),
1216 AstFactory.block([]))); 1195 AstFactory.block()));
1217 } 1196 }
1218 1197
1219 void test_visitIfStatement_withoutElse() { 1198 void test_visitIfStatement_withoutElse() {
1220 _assertClone( 1199 _assertClone(
1221 AstFactory.ifStatement(AstFactory.identifier3("c"), AstFactory.block([]) )); 1200 AstFactory.ifStatement(AstFactory.identifier3("c"), AstFactory.block())) ;
1222 } 1201 }
1223 1202
1224 void test_visitImplementsClause_multiple() { 1203 void test_visitImplementsClause_multiple() {
1225 _assertClone( 1204 _assertClone(
1226 AstFactory.implementsClause( 1205 AstFactory.implementsClause(
1227 [AstFactory.typeName4("A", []), AstFactory.typeName4("B", [])])); 1206 [AstFactory.typeName4("A"), AstFactory.typeName4("B")]));
1228 } 1207 }
1229 1208
1230 void test_visitImplementsClause_single() { 1209 void test_visitImplementsClause_single() {
1231 _assertClone(AstFactory.implementsClause([AstFactory.typeName4("A", [])])); 1210 _assertClone(AstFactory.implementsClause([AstFactory.typeName4("A")]));
1232 } 1211 }
1233 1212
1234 void test_visitImportDirective_combinator() { 1213 void test_visitImportDirective_combinator() {
1235 _assertClone( 1214 _assertClone(
1236 AstFactory.importDirective3( 1215 AstFactory.importDirective3(
1237 "a.dart", 1216 "a.dart",
1238 null, 1217 null,
1239 [AstFactory.showCombinator([AstFactory.identifier3("A")])])); 1218 [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
1240 } 1219 }
1241 1220
1242 void test_visitImportDirective_combinators() { 1221 void test_visitImportDirective_combinators() {
1243 _assertClone( 1222 _assertClone(
1244 AstFactory.importDirective3( 1223 AstFactory.importDirective3(
1245 "a.dart", 1224 "a.dart",
1246 null, 1225 null,
1247 [ 1226 [
1248 AstFactory.showCombinator([AstFactory.identifier3("A")]), 1227 AstFactory.showCombinator([AstFactory.identifier3("A")]),
1249 AstFactory.hideCombinator([AstFactory.identifier3("B")])])); 1228 AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
1250 } 1229 }
1251 1230
1252 void test_visitImportDirective_minimal() { 1231 void test_visitImportDirective_minimal() {
1253 _assertClone(AstFactory.importDirective3("a.dart", null, [])); 1232 _assertClone(AstFactory.importDirective3("a.dart", null));
1254 } 1233 }
1255 1234
1256 void test_visitImportDirective_prefix() { 1235 void test_visitImportDirective_prefix() {
1257 _assertClone(AstFactory.importDirective3("a.dart", "p", [])); 1236 _assertClone(AstFactory.importDirective3("a.dart", "p"));
1258 } 1237 }
1259 1238
1260 void test_visitImportDirective_prefix_combinator() { 1239 void test_visitImportDirective_prefix_combinator() {
1261 _assertClone( 1240 _assertClone(
1262 AstFactory.importDirective3( 1241 AstFactory.importDirective3(
1263 "a.dart", 1242 "a.dart",
1264 "p", 1243 "p",
1265 [AstFactory.showCombinator([AstFactory.identifier3("A")])])); 1244 [AstFactory.showCombinator([AstFactory.identifier3("A")])]));
1266 } 1245 }
1267 1246
1268 void test_visitImportDirective_prefix_combinators() { 1247 void test_visitImportDirective_prefix_combinators() {
1269 _assertClone( 1248 _assertClone(
1270 AstFactory.importDirective3( 1249 AstFactory.importDirective3(
1271 "a.dart", 1250 "a.dart",
1272 "p", 1251 "p",
1273 [ 1252 [
1274 AstFactory.showCombinator([AstFactory.identifier3("A")]), 1253 AstFactory.showCombinator([AstFactory.identifier3("A")]),
1275 AstFactory.hideCombinator([AstFactory.identifier3("B")])])); 1254 AstFactory.hideCombinator([AstFactory.identifier3("B")])]));
1276 } 1255 }
1277 1256
1278 void test_visitImportDirective_withMetadata() { 1257 void test_visitImportDirective_withMetadata() {
1279 ImportDirective directive = AstFactory.importDirective3("a.dart", null, []); 1258 ImportDirective directive = AstFactory.importDirective3("a.dart", null);
1280 directive.metadata = 1259 directive.metadata =
1281 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1260 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1282 _assertClone(directive); 1261 _assertClone(directive);
1283 } 1262 }
1284 1263
1285 void test_visitImportHideCombinator_multiple() { 1264 void test_visitImportHideCombinator_multiple() {
1286 _assertClone( 1265 _assertClone(
1287 AstFactory.hideCombinator( 1266 AstFactory.hideCombinator(
1288 [AstFactory.identifier3("a"), AstFactory.identifier3("b")])); 1267 [AstFactory.identifier3("a"), AstFactory.identifier3("b")]));
1289 } 1268 }
1290 1269
1291 void test_visitImportHideCombinator_single() { 1270 void test_visitImportHideCombinator_single() {
(...skipping 14 matching lines...) Expand all
1306 _assertClone( 1285 _assertClone(
1307 AstFactory.indexExpression( 1286 AstFactory.indexExpression(
1308 AstFactory.identifier3("a"), 1287 AstFactory.identifier3("a"),
1309 AstFactory.identifier3("i"))); 1288 AstFactory.identifier3("i")));
1310 } 1289 }
1311 1290
1312 void test_visitInstanceCreationExpression_const() { 1291 void test_visitInstanceCreationExpression_const() {
1313 _assertClone( 1292 _assertClone(
1314 AstFactory.instanceCreationExpression2( 1293 AstFactory.instanceCreationExpression2(
1315 Keyword.CONST, 1294 Keyword.CONST,
1316 AstFactory.typeName4("C", []), 1295 AstFactory.typeName4("C")));
1317 []));
1318 } 1296 }
1319 1297
1320 void test_visitInstanceCreationExpression_named() { 1298 void test_visitInstanceCreationExpression_named() {
1321 _assertClone( 1299 _assertClone(
1322 AstFactory.instanceCreationExpression3( 1300 AstFactory.instanceCreationExpression3(
1323 Keyword.NEW, 1301 Keyword.NEW,
1324 AstFactory.typeName4("C", []), 1302 AstFactory.typeName4("C"),
1325 "c", 1303 "c"));
1326 []));
1327 } 1304 }
1328 1305
1329 void test_visitInstanceCreationExpression_unnamed() { 1306 void test_visitInstanceCreationExpression_unnamed() {
1330 _assertClone( 1307 _assertClone(
1331 AstFactory.instanceCreationExpression2( 1308 AstFactory.instanceCreationExpression2(
1332 Keyword.NEW, 1309 Keyword.NEW,
1333 AstFactory.typeName4("C", []), 1310 AstFactory.typeName4("C")));
1334 []));
1335 } 1311 }
1336 1312
1337 void test_visitIntegerLiteral() { 1313 void test_visitIntegerLiteral() {
1338 _assertClone(AstFactory.integer(42)); 1314 _assertClone(AstFactory.integer(42));
1339 } 1315 }
1340 1316
1341 void test_visitInterpolationExpression_expression() { 1317 void test_visitInterpolationExpression_expression() {
1342 _assertClone( 1318 _assertClone(
1343 AstFactory.interpolationExpression(AstFactory.identifier3("a"))); 1319 AstFactory.interpolationExpression(AstFactory.identifier3("a")));
1344 } 1320 }
1345 1321
1346 void test_visitInterpolationExpression_identifier() { 1322 void test_visitInterpolationExpression_identifier() {
1347 _assertClone(AstFactory.interpolationExpression2("a")); 1323 _assertClone(AstFactory.interpolationExpression2("a"));
1348 } 1324 }
1349 1325
1350 void test_visitInterpolationString() { 1326 void test_visitInterpolationString() {
1351 _assertClone(AstFactory.interpolationString("'x", "x")); 1327 _assertClone(AstFactory.interpolationString("'x", "x"));
1352 } 1328 }
1353 1329
1354 void test_visitIsExpression_negated() { 1330 void test_visitIsExpression_negated() {
1355 _assertClone( 1331 _assertClone(
1356 AstFactory.isExpression( 1332 AstFactory.isExpression(
1357 AstFactory.identifier3("a"), 1333 AstFactory.identifier3("a"),
1358 true, 1334 true,
1359 AstFactory.typeName4("C", []))); 1335 AstFactory.typeName4("C")));
1360 } 1336 }
1361 1337
1362 void test_visitIsExpression_normal() { 1338 void test_visitIsExpression_normal() {
1363 _assertClone( 1339 _assertClone(
1364 AstFactory.isExpression( 1340 AstFactory.isExpression(
1365 AstFactory.identifier3("a"), 1341 AstFactory.identifier3("a"),
1366 false, 1342 false,
1367 AstFactory.typeName4("C", []))); 1343 AstFactory.typeName4("C")));
1368 } 1344 }
1369 1345
1370 void test_visitLabel() { 1346 void test_visitLabel() {
1371 _assertClone(AstFactory.label2("a")); 1347 _assertClone(AstFactory.label2("a"));
1372 } 1348 }
1373 1349
1374 void test_visitLabeledStatement_multiple() { 1350 void test_visitLabeledStatement_multiple() {
1375 _assertClone( 1351 _assertClone(
1376 AstFactory.labeledStatement( 1352 AstFactory.labeledStatement(
1377 AstFactory.list([AstFactory.label2("a"), AstFactory.label2("b")]), 1353 [AstFactory.label2("a"), AstFactory.label2("b")],
1378 AstFactory.returnStatement())); 1354 AstFactory.returnStatement()));
1379 } 1355 }
1380 1356
1381 void test_visitLabeledStatement_single() { 1357 void test_visitLabeledStatement_single() {
1382 _assertClone( 1358 _assertClone(
1383 AstFactory.labeledStatement( 1359 AstFactory.labeledStatement(
1384 AstFactory.list([AstFactory.label2("a")]), 1360 [AstFactory.label2("a")],
1385 AstFactory.returnStatement())); 1361 AstFactory.returnStatement()));
1386 } 1362 }
1387 1363
1388 void test_visitLibraryDirective() { 1364 void test_visitLibraryDirective() {
1389 _assertClone(AstFactory.libraryDirective2("l")); 1365 _assertClone(AstFactory.libraryDirective2("l"));
1390 } 1366 }
1391 1367
1392 void test_visitLibraryDirective_withMetadata() { 1368 void test_visitLibraryDirective_withMetadata() {
1393 LibraryDirective directive = AstFactory.libraryDirective2("l"); 1369 LibraryDirective directive = AstFactory.libraryDirective2("l");
1394 directive.metadata = 1370 directive.metadata =
1395 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1371 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1396 _assertClone(directive); 1372 _assertClone(directive);
1397 } 1373 }
1398 1374
1399 void test_visitLibraryIdentifier_multiple() { 1375 void test_visitLibraryIdentifier_multiple() {
1400 _assertClone( 1376 _assertClone(
1401 AstFactory.libraryIdentifier( 1377 AstFactory.libraryIdentifier(
1402 [ 1378 [
1403 AstFactory.identifier3("a"), 1379 AstFactory.identifier3("a"),
1404 AstFactory.identifier3("b"), 1380 AstFactory.identifier3("b"),
1405 AstFactory.identifier3("c")])); 1381 AstFactory.identifier3("c")]));
1406 } 1382 }
1407 1383
1408 void test_visitLibraryIdentifier_single() { 1384 void test_visitLibraryIdentifier_single() {
1409 _assertClone(AstFactory.libraryIdentifier([AstFactory.identifier3("a")])); 1385 _assertClone(AstFactory.libraryIdentifier([AstFactory.identifier3("a")]));
1410 } 1386 }
1411 1387
1412 void test_visitListLiteral_const() { 1388 void test_visitListLiteral_const() {
1413 _assertClone(AstFactory.listLiteral2(Keyword.CONST, null, [])); 1389 _assertClone(AstFactory.listLiteral2(Keyword.CONST, null));
1414 } 1390 }
1415 1391
1416 void test_visitListLiteral_empty() { 1392 void test_visitListLiteral_empty() {
1417 _assertClone(AstFactory.listLiteral([])); 1393 _assertClone(AstFactory.listLiteral());
1418 } 1394 }
1419 1395
1420 void test_visitListLiteral_nonEmpty() { 1396 void test_visitListLiteral_nonEmpty() {
1421 _assertClone( 1397 _assertClone(
1422 AstFactory.listLiteral( 1398 AstFactory.listLiteral(
1423 [ 1399 [
1424 AstFactory.identifier3("a"), 1400 AstFactory.identifier3("a"),
1425 AstFactory.identifier3("b"), 1401 AstFactory.identifier3("b"),
1426 AstFactory.identifier3("c")])); 1402 AstFactory.identifier3("c")]));
1427 } 1403 }
1428 1404
1429 void test_visitMapLiteralEntry() { 1405 void test_visitMapLiteralEntry() {
1430 _assertClone(AstFactory.mapLiteralEntry("a", AstFactory.identifier3("b"))); 1406 _assertClone(AstFactory.mapLiteralEntry("a", AstFactory.identifier3("b")));
1431 } 1407 }
1432 1408
1433 void test_visitMapLiteral_const() { 1409 void test_visitMapLiteral_const() {
1434 _assertClone(AstFactory.mapLiteral(Keyword.CONST, null, [])); 1410 _assertClone(AstFactory.mapLiteral(Keyword.CONST, null));
1435 } 1411 }
1436 1412
1437 void test_visitMapLiteral_empty() { 1413 void test_visitMapLiteral_empty() {
1438 _assertClone(AstFactory.mapLiteral2([])); 1414 _assertClone(AstFactory.mapLiteral2());
1439 } 1415 }
1440 1416
1441 void test_visitMapLiteral_nonEmpty() { 1417 void test_visitMapLiteral_nonEmpty() {
1442 _assertClone( 1418 _assertClone(
1443 AstFactory.mapLiteral2( 1419 AstFactory.mapLiteral2(
1444 [ 1420 [
1445 AstFactory.mapLiteralEntry("a", AstFactory.identifier3("a")), 1421 AstFactory.mapLiteralEntry("a", AstFactory.identifier3("a")),
1446 AstFactory.mapLiteralEntry("b", AstFactory.identifier3("b")), 1422 AstFactory.mapLiteralEntry("b", AstFactory.identifier3("b")),
1447 AstFactory.mapLiteralEntry("c", AstFactory.identifier3("c"))])); 1423 AstFactory.mapLiteralEntry("c", AstFactory.identifier3("c"))]));
1448 } 1424 }
1449 1425
1450 void test_visitMethodDeclaration_external() { 1426 void test_visitMethodDeclaration_external() {
1451 _assertClone( 1427 _assertClone(
1452 AstFactory.methodDeclaration( 1428 AstFactory.methodDeclaration(
1453 null, 1429 null,
1454 null, 1430 null,
1455 null, 1431 null,
1456 null, 1432 null,
1457 AstFactory.identifier3("m"), 1433 AstFactory.identifier3("m"),
1458 AstFactory.formalParameterList([]))); 1434 AstFactory.formalParameterList()));
1459 } 1435 }
1460 1436
1461 void test_visitMethodDeclaration_external_returnType() { 1437 void test_visitMethodDeclaration_external_returnType() {
1462 _assertClone( 1438 _assertClone(
1463 AstFactory.methodDeclaration( 1439 AstFactory.methodDeclaration(
1464 null, 1440 null,
1465 AstFactory.typeName4("T", []), 1441 AstFactory.typeName4("T"),
1466 null, 1442 null,
1467 null, 1443 null,
1468 AstFactory.identifier3("m"), 1444 AstFactory.identifier3("m"),
1469 AstFactory.formalParameterList([]))); 1445 AstFactory.formalParameterList()));
1470 } 1446 }
1471 1447
1472 void test_visitMethodDeclaration_getter() { 1448 void test_visitMethodDeclaration_getter() {
1473 _assertClone( 1449 _assertClone(
1474 AstFactory.methodDeclaration2( 1450 AstFactory.methodDeclaration2(
1475 null, 1451 null,
1476 null, 1452 null,
1477 Keyword.GET, 1453 Keyword.GET,
1478 null, 1454 null,
1479 AstFactory.identifier3("m"), 1455 AstFactory.identifier3("m"),
1480 null, 1456 null,
1481 AstFactory.blockFunctionBody2([]))); 1457 AstFactory.blockFunctionBody2()));
1482 } 1458 }
1483 1459
1484 void test_visitMethodDeclaration_getter_returnType() { 1460 void test_visitMethodDeclaration_getter_returnType() {
1485 _assertClone( 1461 _assertClone(
1486 AstFactory.methodDeclaration2( 1462 AstFactory.methodDeclaration2(
1487 null, 1463 null,
1488 AstFactory.typeName4("T", []), 1464 AstFactory.typeName4("T"),
1489 Keyword.GET, 1465 Keyword.GET,
1490 null, 1466 null,
1491 AstFactory.identifier3("m"), 1467 AstFactory.identifier3("m"),
1492 null, 1468 null,
1493 AstFactory.blockFunctionBody2([]))); 1469 AstFactory.blockFunctionBody2()));
1494 } 1470 }
1495 1471
1496 void test_visitMethodDeclaration_getter_seturnType() { 1472 void test_visitMethodDeclaration_getter_seturnType() {
1497 _assertClone( 1473 _assertClone(
1498 AstFactory.methodDeclaration2( 1474 AstFactory.methodDeclaration2(
1499 null, 1475 null,
1500 AstFactory.typeName4("T", []), 1476 AstFactory.typeName4("T"),
1501 Keyword.SET, 1477 Keyword.SET,
1502 null, 1478 null,
1503 AstFactory.identifier3("m"), 1479 AstFactory.identifier3("m"),
1504 AstFactory.formalParameterList( 1480 AstFactory.formalParameterList(
1505 [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]), 1481 [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
1506 AstFactory.blockFunctionBody2([]))); 1482 AstFactory.blockFunctionBody2()));
1507 } 1483 }
1508 1484
1509 void test_visitMethodDeclaration_minimal() { 1485 void test_visitMethodDeclaration_minimal() {
1510 _assertClone( 1486 _assertClone(
1511 AstFactory.methodDeclaration2( 1487 AstFactory.methodDeclaration2(
1512 null, 1488 null,
1513 null, 1489 null,
1514 null, 1490 null,
1515 null, 1491 null,
1516 AstFactory.identifier3("m"), 1492 AstFactory.identifier3("m"),
1517 AstFactory.formalParameterList([]), 1493 AstFactory.formalParameterList(),
1518 AstFactory.blockFunctionBody2([]))); 1494 AstFactory.blockFunctionBody2()));
1519 } 1495 }
1520 1496
1521 void test_visitMethodDeclaration_multipleParameters() { 1497 void test_visitMethodDeclaration_multipleParameters() {
1522 _assertClone( 1498 _assertClone(
1523 AstFactory.methodDeclaration2( 1499 AstFactory.methodDeclaration2(
1524 null, 1500 null,
1525 null, 1501 null,
1526 null, 1502 null,
1527 null, 1503 null,
1528 AstFactory.identifier3("m"), 1504 AstFactory.identifier3("m"),
1529 AstFactory.formalParameterList( 1505 AstFactory.formalParameterList(
1530 [ 1506 [
1531 AstFactory.simpleFormalParameter(Keyword.VAR, "a"), 1507 AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
1532 AstFactory.simpleFormalParameter(Keyword.VAR, "b")]), 1508 AstFactory.simpleFormalParameter(Keyword.VAR, "b")]),
1533 AstFactory.blockFunctionBody2([]))); 1509 AstFactory.blockFunctionBody2()));
1534 } 1510 }
1535 1511
1536 void test_visitMethodDeclaration_operator() { 1512 void test_visitMethodDeclaration_operator() {
1537 _assertClone( 1513 _assertClone(
1538 AstFactory.methodDeclaration2( 1514 AstFactory.methodDeclaration2(
1539 null, 1515 null,
1540 null, 1516 null,
1541 null, 1517 null,
1542 Keyword.OPERATOR, 1518 Keyword.OPERATOR,
1543 AstFactory.identifier3("+"), 1519 AstFactory.identifier3("+"),
1544 AstFactory.formalParameterList([]), 1520 AstFactory.formalParameterList(),
1545 AstFactory.blockFunctionBody2([]))); 1521 AstFactory.blockFunctionBody2()));
1546 } 1522 }
1547 1523
1548 void test_visitMethodDeclaration_operator_returnType() { 1524 void test_visitMethodDeclaration_operator_returnType() {
1549 _assertClone( 1525 _assertClone(
1550 AstFactory.methodDeclaration2( 1526 AstFactory.methodDeclaration2(
1551 null, 1527 null,
1552 AstFactory.typeName4("T", []), 1528 AstFactory.typeName4("T"),
1553 null, 1529 null,
1554 Keyword.OPERATOR, 1530 Keyword.OPERATOR,
1555 AstFactory.identifier3("+"), 1531 AstFactory.identifier3("+"),
1556 AstFactory.formalParameterList([]), 1532 AstFactory.formalParameterList(),
1557 AstFactory.blockFunctionBody2([]))); 1533 AstFactory.blockFunctionBody2()));
1558 } 1534 }
1559 1535
1560 void test_visitMethodDeclaration_returnType() { 1536 void test_visitMethodDeclaration_returnType() {
1561 _assertClone( 1537 _assertClone(
1562 AstFactory.methodDeclaration2( 1538 AstFactory.methodDeclaration2(
1563 null, 1539 null,
1564 AstFactory.typeName4("T", []), 1540 AstFactory.typeName4("T"),
1565 null, 1541 null,
1566 null, 1542 null,
1567 AstFactory.identifier3("m"), 1543 AstFactory.identifier3("m"),
1568 AstFactory.formalParameterList([]), 1544 AstFactory.formalParameterList(),
1569 AstFactory.blockFunctionBody2([]))); 1545 AstFactory.blockFunctionBody2()));
1570 } 1546 }
1571 1547
1572 void test_visitMethodDeclaration_setter() { 1548 void test_visitMethodDeclaration_setter() {
1573 _assertClone( 1549 _assertClone(
1574 AstFactory.methodDeclaration2( 1550 AstFactory.methodDeclaration2(
1575 null, 1551 null,
1576 null, 1552 null,
1577 Keyword.SET, 1553 Keyword.SET,
1578 null, 1554 null,
1579 AstFactory.identifier3("m"), 1555 AstFactory.identifier3("m"),
1580 AstFactory.formalParameterList( 1556 AstFactory.formalParameterList(
1581 [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]), 1557 [AstFactory.simpleFormalParameter(Keyword.VAR, "v")]),
1582 AstFactory.blockFunctionBody2([]))); 1558 AstFactory.blockFunctionBody2()));
1583 } 1559 }
1584 1560
1585 void test_visitMethodDeclaration_static() { 1561 void test_visitMethodDeclaration_static() {
1586 _assertClone( 1562 _assertClone(
1587 AstFactory.methodDeclaration2( 1563 AstFactory.methodDeclaration2(
1588 Keyword.STATIC, 1564 Keyword.STATIC,
1589 null, 1565 null,
1590 null, 1566 null,
1591 null, 1567 null,
1592 AstFactory.identifier3("m"), 1568 AstFactory.identifier3("m"),
1593 AstFactory.formalParameterList([]), 1569 AstFactory.formalParameterList(),
1594 AstFactory.blockFunctionBody2([]))); 1570 AstFactory.blockFunctionBody2()));
1595 } 1571 }
1596 1572
1597 void test_visitMethodDeclaration_static_returnType() { 1573 void test_visitMethodDeclaration_static_returnType() {
1598 _assertClone( 1574 _assertClone(
1599 AstFactory.methodDeclaration2( 1575 AstFactory.methodDeclaration2(
1600 Keyword.STATIC, 1576 Keyword.STATIC,
1601 AstFactory.typeName4("T", []), 1577 AstFactory.typeName4("T"),
1602 null, 1578 null,
1603 null, 1579 null,
1604 AstFactory.identifier3("m"), 1580 AstFactory.identifier3("m"),
1605 AstFactory.formalParameterList([]), 1581 AstFactory.formalParameterList(),
1606 AstFactory.blockFunctionBody2([]))); 1582 AstFactory.blockFunctionBody2()));
1607 } 1583 }
1608 1584
1609 void test_visitMethodDeclaration_withMetadata() { 1585 void test_visitMethodDeclaration_withMetadata() {
1610 MethodDeclaration declaration = AstFactory.methodDeclaration2( 1586 MethodDeclaration declaration = AstFactory.methodDeclaration2(
1611 null, 1587 null,
1612 null, 1588 null,
1613 null, 1589 null,
1614 null, 1590 null,
1615 AstFactory.identifier3("m"), 1591 AstFactory.identifier3("m"),
1616 AstFactory.formalParameterList([]), 1592 AstFactory.formalParameterList(),
1617 AstFactory.blockFunctionBody2([])); 1593 AstFactory.blockFunctionBody2());
1618 declaration.metadata = 1594 declaration.metadata =
1619 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1595 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1620 _assertClone(declaration); 1596 _assertClone(declaration);
1621 } 1597 }
1622 1598
1623 void test_visitMethodInvocation_noTarget() { 1599 void test_visitMethodInvocation_noTarget() {
1624 _assertClone(AstFactory.methodInvocation2("m", [])); 1600 _assertClone(AstFactory.methodInvocation2("m"));
1625 } 1601 }
1626 1602
1627 void test_visitMethodInvocation_target() { 1603 void test_visitMethodInvocation_target() {
1628 _assertClone( 1604 _assertClone(
1629 AstFactory.methodInvocation(AstFactory.identifier3("t"), "m", [])); 1605 AstFactory.methodInvocation(AstFactory.identifier3("t"), "m"));
1630 } 1606 }
1631 1607
1632 void test_visitNamedExpression() { 1608 void test_visitNamedExpression() {
1633 _assertClone(AstFactory.namedExpression2("a", AstFactory.identifier3("b"))); 1609 _assertClone(AstFactory.namedExpression2("a", AstFactory.identifier3("b")));
1634 } 1610 }
1635 1611
1636 void test_visitNamedFormalParameter() { 1612 void test_visitNamedFormalParameter() {
1637 _assertClone( 1613 _assertClone(
1638 AstFactory.namedFormalParameter( 1614 AstFactory.namedFormalParameter(
1639 AstFactory.simpleFormalParameter(Keyword.VAR, "a"), 1615 AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
(...skipping 17 matching lines...) Expand all
1657 AstFactory.parenthesizedExpression(AstFactory.identifier3("a"))); 1633 AstFactory.parenthesizedExpression(AstFactory.identifier3("a")));
1658 } 1634 }
1659 1635
1660 void test_visitPartDirective() { 1636 void test_visitPartDirective() {
1661 _assertClone(AstFactory.partDirective2("a.dart")); 1637 _assertClone(AstFactory.partDirective2("a.dart"));
1662 } 1638 }
1663 1639
1664 void test_visitPartDirective_withMetadata() { 1640 void test_visitPartDirective_withMetadata() {
1665 PartDirective directive = AstFactory.partDirective2("a.dart"); 1641 PartDirective directive = AstFactory.partDirective2("a.dart");
1666 directive.metadata = 1642 directive.metadata =
1667 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1643 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1668 _assertClone(directive); 1644 _assertClone(directive);
1669 } 1645 }
1670 1646
1671 void test_visitPartOfDirective() { 1647 void test_visitPartOfDirective() {
1672 _assertClone( 1648 _assertClone(
1673 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]))); 1649 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"])));
1674 } 1650 }
1675 1651
1676 void test_visitPartOfDirective_withMetadata() { 1652 void test_visitPartOfDirective_withMetadata() {
1677 PartOfDirective directive = 1653 PartOfDirective directive =
1678 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"])); 1654 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["l"]));
1679 directive.metadata = 1655 directive.metadata =
1680 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1656 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1681 _assertClone(directive); 1657 _assertClone(directive);
1682 } 1658 }
1683 1659
1684 void test_visitPositionalFormalParameter() { 1660 void test_visitPositionalFormalParameter() {
1685 _assertClone( 1661 _assertClone(
1686 AstFactory.positionalFormalParameter( 1662 AstFactory.positionalFormalParameter(
1687 AstFactory.simpleFormalParameter(Keyword.VAR, "a"), 1663 AstFactory.simpleFormalParameter(Keyword.VAR, "a"),
1688 AstFactory.integer(0))); 1664 AstFactory.integer(0)));
1689 } 1665 }
1690 1666
1691 void test_visitPostfixExpression() { 1667 void test_visitPostfixExpression() {
1692 _assertClone( 1668 _assertClone(
1693 AstFactory.postfixExpression(AstFactory.identifier3("a"), TokenType.PLUS _PLUS)); 1669 AstFactory.postfixExpression(AstFactory.identifier3("a"), TokenType.PLUS _PLUS));
1694 } 1670 }
1695 1671
1696 void test_visitPrefixExpression() { 1672 void test_visitPrefixExpression() {
1697 _assertClone( 1673 _assertClone(
1698 AstFactory.prefixExpression(TokenType.MINUS, AstFactory.identifier3("a") )); 1674 AstFactory.prefixExpression(TokenType.MINUS, AstFactory.identifier3("a") ));
1699 } 1675 }
1700 1676
1701 void test_visitPrefixedIdentifier() { 1677 void test_visitPrefixedIdentifier() {
1702 _assertClone(AstFactory.identifier5("a", "b")); 1678 _assertClone(AstFactory.identifier5("a", "b"));
1703 } 1679 }
1704 1680
1705 void test_visitPropertyAccess() { 1681 void test_visitPropertyAccess() {
1706 _assertClone(AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b")); 1682 _assertClone(AstFactory.propertyAccess2(AstFactory.identifier3("a"), "b"));
1707 } 1683 }
1708 1684
1709 void test_visitRedirectingConstructorInvocation_named() { 1685 void test_visitRedirectingConstructorInvocation_named() {
1710 _assertClone(AstFactory.redirectingConstructorInvocation2("c", [])); 1686 _assertClone(AstFactory.redirectingConstructorInvocation2("c"));
1711 } 1687 }
1712 1688
1713 void test_visitRedirectingConstructorInvocation_unnamed() { 1689 void test_visitRedirectingConstructorInvocation_unnamed() {
1714 _assertClone(AstFactory.redirectingConstructorInvocation([])); 1690 _assertClone(AstFactory.redirectingConstructorInvocation());
1715 } 1691 }
1716 1692
1717 void test_visitRethrowExpression() { 1693 void test_visitRethrowExpression() {
1718 _assertClone(AstFactory.rethrowExpression()); 1694 _assertClone(AstFactory.rethrowExpression());
1719 } 1695 }
1720 1696
1721 void test_visitReturnStatement_expression() { 1697 void test_visitReturnStatement_expression() {
1722 _assertClone(AstFactory.returnStatement2(AstFactory.identifier3("a"))); 1698 _assertClone(AstFactory.returnStatement2(AstFactory.identifier3("a")));
1723 } 1699 }
1724 1700
1725 void test_visitReturnStatement_noExpression() { 1701 void test_visitReturnStatement_noExpression() {
1726 _assertClone(AstFactory.returnStatement()); 1702 _assertClone(AstFactory.returnStatement());
1727 } 1703 }
1728 1704
1729 void test_visitScriptTag() { 1705 void test_visitScriptTag() {
1730 String scriptTag = "!#/bin/dart.exe"; 1706 String scriptTag = "!#/bin/dart.exe";
1731 _assertClone(AstFactory.scriptTag(scriptTag)); 1707 _assertClone(AstFactory.scriptTag(scriptTag));
1732 } 1708 }
1733 1709
1734 void test_visitSimpleFormalParameter_keyword() { 1710 void test_visitSimpleFormalParameter_keyword() {
1735 _assertClone(AstFactory.simpleFormalParameter(Keyword.VAR, "a")); 1711 _assertClone(AstFactory.simpleFormalParameter(Keyword.VAR, "a"));
1736 } 1712 }
1737 1713
1738 void test_visitSimpleFormalParameter_keyword_type() { 1714 void test_visitSimpleFormalParameter_keyword_type() {
1739 _assertClone( 1715 _assertClone(
1740 AstFactory.simpleFormalParameter2( 1716 AstFactory.simpleFormalParameter2(
1741 Keyword.FINAL, 1717 Keyword.FINAL,
1742 AstFactory.typeName4("A", []), 1718 AstFactory.typeName4("A"),
1743 "a")); 1719 "a"));
1744 } 1720 }
1745 1721
1746 void test_visitSimpleFormalParameter_type() { 1722 void test_visitSimpleFormalParameter_type() {
1747 _assertClone( 1723 _assertClone(
1748 AstFactory.simpleFormalParameter4(AstFactory.typeName4("A", []), "a")); 1724 AstFactory.simpleFormalParameter4(AstFactory.typeName4("A"), "a"));
1749 } 1725 }
1750 1726
1751 void test_visitSimpleIdentifier() { 1727 void test_visitSimpleIdentifier() {
1752 _assertClone(AstFactory.identifier3("a")); 1728 _assertClone(AstFactory.identifier3("a"));
1753 } 1729 }
1754 1730
1755 void test_visitSimpleStringLiteral() { 1731 void test_visitSimpleStringLiteral() {
1756 _assertClone(AstFactory.string2("a")); 1732 _assertClone(AstFactory.string2("a"));
1757 } 1733 }
1758 1734
1759 void test_visitStringInterpolation() { 1735 void test_visitStringInterpolation() {
1760 _assertClone( 1736 _assertClone(
1761 AstFactory.string( 1737 AstFactory.string(
1762 [ 1738 [
1763 AstFactory.interpolationString("'a", "a"), 1739 AstFactory.interpolationString("'a", "a"),
1764 AstFactory.interpolationExpression(AstFactory.identifier3("e")), 1740 AstFactory.interpolationExpression(AstFactory.identifier3("e")),
1765 AstFactory.interpolationString("b'", "b")])); 1741 AstFactory.interpolationString("b'", "b")]));
1766 } 1742 }
1767 1743
1768 void test_visitSuperConstructorInvocation() { 1744 void test_visitSuperConstructorInvocation() {
1769 _assertClone(AstFactory.superConstructorInvocation([])); 1745 _assertClone(AstFactory.superConstructorInvocation());
1770 } 1746 }
1771 1747
1772 void test_visitSuperConstructorInvocation_named() { 1748 void test_visitSuperConstructorInvocation_named() {
1773 _assertClone(AstFactory.superConstructorInvocation2("c", [])); 1749 _assertClone(AstFactory.superConstructorInvocation2("c"));
1774 } 1750 }
1775 1751
1776 void test_visitSuperExpression() { 1752 void test_visitSuperExpression() {
1777 _assertClone(AstFactory.superExpression()); 1753 _assertClone(AstFactory.superExpression());
1778 } 1754 }
1779 1755
1780 void test_visitSwitchCase_multipleLabels() { 1756 void test_visitSwitchCase_multipleLabels() {
1781 _assertClone( 1757 _assertClone(
1782 AstFactory.switchCase2( 1758 AstFactory.switchCase2(
1783 AstFactory.list([AstFactory.label2("l1"), AstFactory.label2("l2")]), 1759 [AstFactory.label2("l1"), AstFactory.label2("l2")],
1784 AstFactory.identifier3("a"), 1760 AstFactory.identifier3("a"),
1785 [AstFactory.block([])])); 1761 [AstFactory.block()]));
1786 } 1762 }
1787 1763
1788 void test_visitSwitchCase_multipleStatements() { 1764 void test_visitSwitchCase_multipleStatements() {
1789 _assertClone( 1765 _assertClone(
1790 AstFactory.switchCase( 1766 AstFactory.switchCase(
1791 AstFactory.identifier3("a"), 1767 AstFactory.identifier3("a"),
1792 [AstFactory.block([]), AstFactory.block([])])); 1768 [AstFactory.block(), AstFactory.block()]));
1793 } 1769 }
1794 1770
1795 void test_visitSwitchCase_noLabels() { 1771 void test_visitSwitchCase_noLabels() {
1796 _assertClone( 1772 _assertClone(
1797 AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block([]) ])); 1773 AstFactory.switchCase(AstFactory.identifier3("a"), [AstFactory.block()]) );
1798 } 1774 }
1799 1775
1800 void test_visitSwitchCase_singleLabel() { 1776 void test_visitSwitchCase_singleLabel() {
1801 _assertClone( 1777 _assertClone(
1802 AstFactory.switchCase2( 1778 AstFactory.switchCase2(
1803 AstFactory.list([AstFactory.label2("l1")]), 1779 [AstFactory.label2("l1")],
1804 AstFactory.identifier3("a"), 1780 AstFactory.identifier3("a"),
1805 [AstFactory.block([])])); 1781 [AstFactory.block()]));
1806 } 1782 }
1807 1783
1808 void test_visitSwitchDefault_multipleLabels() { 1784 void test_visitSwitchDefault_multipleLabels() {
1809 _assertClone( 1785 _assertClone(
1810 AstFactory.switchDefault( 1786 AstFactory.switchDefault(
1811 AstFactory.list([AstFactory.label2("l1"), AstFactory.label2("l2")]), 1787 [AstFactory.label2("l1"), AstFactory.label2("l2")],
1812 [AstFactory.block([])])); 1788 [AstFactory.block()]));
1813 } 1789 }
1814 1790
1815 void test_visitSwitchDefault_multipleStatements() { 1791 void test_visitSwitchDefault_multipleStatements() {
1816 _assertClone( 1792 _assertClone(
1817 AstFactory.switchDefault2([AstFactory.block([]), AstFactory.block([])])) ; 1793 AstFactory.switchDefault2([AstFactory.block(), AstFactory.block()]));
1818 } 1794 }
1819 1795
1820 void test_visitSwitchDefault_noLabels() { 1796 void test_visitSwitchDefault_noLabels() {
1821 _assertClone(AstFactory.switchDefault2([AstFactory.block([])])); 1797 _assertClone(AstFactory.switchDefault2([AstFactory.block()]));
1822 } 1798 }
1823 1799
1824 void test_visitSwitchDefault_singleLabel() { 1800 void test_visitSwitchDefault_singleLabel() {
1825 _assertClone( 1801 _assertClone(
1826 AstFactory.switchDefault( 1802 AstFactory.switchDefault(
1827 AstFactory.list([AstFactory.label2("l1")]), 1803 [AstFactory.label2("l1")],
1828 [AstFactory.block([])])); 1804 [AstFactory.block()]));
1829 } 1805 }
1830 1806
1831 void test_visitSwitchStatement() { 1807 void test_visitSwitchStatement() {
1832 _assertClone( 1808 _assertClone(
1833 AstFactory.switchStatement( 1809 AstFactory.switchStatement(
1834 AstFactory.identifier3("a"), 1810 AstFactory.identifier3("a"),
1835 [ 1811 [
1836 AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block ([])]), 1812 AstFactory.switchCase(AstFactory.string2("b"), [AstFactory.block ()]),
1837 AstFactory.switchDefault2([AstFactory.block([])])])); 1813 AstFactory.switchDefault2([AstFactory.block()])]));
1838 } 1814 }
1839 1815
1840 void test_visitSymbolLiteral_multiple() { 1816 void test_visitSymbolLiteral_multiple() {
1841 _assertClone(AstFactory.symbolLiteral(["a", "b", "c"])); 1817 _assertClone(AstFactory.symbolLiteral(["a", "b", "c"]));
1842 } 1818 }
1843 1819
1844 void test_visitSymbolLiteral_single() { 1820 void test_visitSymbolLiteral_single() {
1845 _assertClone(AstFactory.symbolLiteral(["a"])); 1821 _assertClone(AstFactory.symbolLiteral(["a"]));
1846 } 1822 }
1847 1823
(...skipping 15 matching lines...) Expand all
1863 void test_visitTopLevelVariableDeclaration_single() { 1839 void test_visitTopLevelVariableDeclaration_single() {
1864 _assertClone( 1840 _assertClone(
1865 AstFactory.topLevelVariableDeclaration2( 1841 AstFactory.topLevelVariableDeclaration2(
1866 Keyword.VAR, 1842 Keyword.VAR,
1867 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")])); 1843 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")]));
1868 } 1844 }
1869 1845
1870 void test_visitTryStatement_catch() { 1846 void test_visitTryStatement_catch() {
1871 _assertClone( 1847 _assertClone(
1872 AstFactory.tryStatement2( 1848 AstFactory.tryStatement2(
1873 AstFactory.block([]), 1849 AstFactory.block(),
1874 [AstFactory.catchClause3(AstFactory.typeName4("E", []), [])])); 1850 [AstFactory.catchClause3(AstFactory.typeName4("E"))]));
1875 } 1851 }
1876 1852
1877 void test_visitTryStatement_catchFinally() { 1853 void test_visitTryStatement_catchFinally() {
1878 _assertClone( 1854 _assertClone(
1879 AstFactory.tryStatement3( 1855 AstFactory.tryStatement3(
1880 AstFactory.block([]), 1856 AstFactory.block(),
1881 AstFactory.list([AstFactory.catchClause3(AstFactory.typeName4("E", [ ]), [])]), 1857 [AstFactory.catchClause3(AstFactory.typeName4("E"))],
1882 AstFactory.block([]))); 1858 AstFactory.block()));
1883 } 1859 }
1884 1860
1885 void test_visitTryStatement_catches() { 1861 void test_visitTryStatement_catches() {
1886 _assertClone( 1862 _assertClone(
1887 AstFactory.tryStatement2( 1863 AstFactory.tryStatement2(
1888 AstFactory.block([]), 1864 AstFactory.block(),
1889 [ 1865 [
1890 AstFactory.catchClause3(AstFactory.typeName4("E", []), []), 1866 AstFactory.catchClause3(AstFactory.typeName4("E")),
1891 AstFactory.catchClause3(AstFactory.typeName4("F", []), [])])); 1867 AstFactory.catchClause3(AstFactory.typeName4("F"))]));
1892 } 1868 }
1893 1869
1894 void test_visitTryStatement_finally() { 1870 void test_visitTryStatement_finally() {
1895 _assertClone( 1871 _assertClone(
1896 AstFactory.tryStatement(AstFactory.block([]), AstFactory.block([]))); 1872 AstFactory.tryStatement(AstFactory.block(), AstFactory.block()));
1897 } 1873 }
1898 1874
1899 void test_visitTypeArgumentList_multiple() { 1875 void test_visitTypeArgumentList_multiple() {
1900 _assertClone( 1876 _assertClone(
1901 AstFactory.typeArgumentList( 1877 AstFactory.typeArgumentList(
1902 [AstFactory.typeName4("E", []), AstFactory.typeName4("F", [])])); 1878 [AstFactory.typeName4("E"), AstFactory.typeName4("F")]));
1903 } 1879 }
1904 1880
1905 void test_visitTypeArgumentList_single() { 1881 void test_visitTypeArgumentList_single() {
1906 _assertClone(AstFactory.typeArgumentList([AstFactory.typeName4("E", [])])); 1882 _assertClone(AstFactory.typeArgumentList([AstFactory.typeName4("E")]));
1907 } 1883 }
1908 1884
1909 void test_visitTypeName_multipleArgs() { 1885 void test_visitTypeName_multipleArgs() {
1910 _assertClone( 1886 _assertClone(
1911 AstFactory.typeName4( 1887 AstFactory.typeName4(
1912 "C", 1888 "C",
1913 [AstFactory.typeName4("D", []), AstFactory.typeName4("E", [])])); 1889 [AstFactory.typeName4("D"), AstFactory.typeName4("E")]));
1914 } 1890 }
1915 1891
1916 void test_visitTypeName_nestedArg() { 1892 void test_visitTypeName_nestedArg() {
1917 _assertClone( 1893 _assertClone(
1918 AstFactory.typeName4( 1894 AstFactory.typeName4(
1919 "C", 1895 "C",
1920 [AstFactory.typeName4("D", [AstFactory.typeName4("E", [])])])); 1896 [AstFactory.typeName4("D", [AstFactory.typeName4("E")])]));
1921 } 1897 }
1922 1898
1923 void test_visitTypeName_noArgs() { 1899 void test_visitTypeName_noArgs() {
1924 _assertClone(AstFactory.typeName4("C", [])); 1900 _assertClone(AstFactory.typeName4("C"));
1925 } 1901 }
1926 1902
1927 void test_visitTypeName_singleArg() { 1903 void test_visitTypeName_singleArg() {
1928 _assertClone(AstFactory.typeName4("C", [AstFactory.typeName4("D", [])])); 1904 _assertClone(AstFactory.typeName4("C", [AstFactory.typeName4("D")]));
1929 } 1905 }
1930 1906
1931 void test_visitTypeParameterList_multiple() { 1907 void test_visitTypeParameterList_multiple() {
1932 _assertClone(AstFactory.typeParameterList(["E", "F"])); 1908 _assertClone(AstFactory.typeParameterList(["E", "F"]));
1933 } 1909 }
1934 1910
1935 void test_visitTypeParameterList_single() { 1911 void test_visitTypeParameterList_single() {
1936 _assertClone(AstFactory.typeParameterList(["E"])); 1912 _assertClone(AstFactory.typeParameterList(["E"]));
1937 } 1913 }
1938 1914
1939 void test_visitTypeParameter_withExtends() { 1915 void test_visitTypeParameter_withExtends() {
1940 _assertClone(AstFactory.typeParameter2("E", AstFactory.typeName4("C", []))); 1916 _assertClone(AstFactory.typeParameter2("E", AstFactory.typeName4("C")));
1941 } 1917 }
1942 1918
1943 void test_visitTypeParameter_withMetadata() { 1919 void test_visitTypeParameter_withMetadata() {
1944 TypeParameter parameter = AstFactory.typeParameter("E"); 1920 TypeParameter parameter = AstFactory.typeParameter("E");
1945 parameter.metadata = 1921 parameter.metadata =
1946 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1922 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1947 _assertClone(parameter); 1923 _assertClone(parameter);
1948 } 1924 }
1949 1925
1950 void test_visitTypeParameter_withoutExtends() { 1926 void test_visitTypeParameter_withoutExtends() {
1951 _assertClone(AstFactory.typeParameter("E")); 1927 _assertClone(AstFactory.typeParameter("E"));
1952 } 1928 }
1953 1929
1954 void test_visitVariableDeclarationList_const_type() { 1930 void test_visitVariableDeclarationList_const_type() {
1955 _assertClone( 1931 _assertClone(
1956 AstFactory.variableDeclarationList( 1932 AstFactory.variableDeclarationList(
1957 Keyword.CONST, 1933 Keyword.CONST,
1958 AstFactory.typeName4("C", []), 1934 AstFactory.typeName4("C"),
1959 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")])); 1935 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")]));
1960 } 1936 }
1961 1937
1962 void test_visitVariableDeclarationList_final_noType() { 1938 void test_visitVariableDeclarationList_final_noType() {
1963 _assertClone( 1939 _assertClone(
1964 AstFactory.variableDeclarationList2( 1940 AstFactory.variableDeclarationList2(
1965 Keyword.FINAL, 1941 Keyword.FINAL,
1966 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")])); 1942 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")]));
1967 } 1943 }
1968 1944
1969 void test_visitVariableDeclarationList_final_withMetadata() { 1945 void test_visitVariableDeclarationList_final_withMetadata() {
1970 VariableDeclarationList declarationList = 1946 VariableDeclarationList declarationList =
1971 AstFactory.variableDeclarationList2( 1947 AstFactory.variableDeclarationList2(
1972 Keyword.FINAL, 1948 Keyword.FINAL,
1973 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")]); 1949 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")]);
1974 declarationList.metadata = 1950 declarationList.metadata =
1975 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1951 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
1976 _assertClone(declarationList); 1952 _assertClone(declarationList);
1977 } 1953 }
1978 1954
1979 void test_visitVariableDeclarationList_type() { 1955 void test_visitVariableDeclarationList_type() {
1980 _assertClone( 1956 _assertClone(
1981 AstFactory.variableDeclarationList( 1957 AstFactory.variableDeclarationList(
1982 null, 1958 null,
1983 AstFactory.typeName4("C", []), 1959 AstFactory.typeName4("C"),
1984 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")])); 1960 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")]));
1985 } 1961 }
1986 1962
1987 void test_visitVariableDeclarationList_var() { 1963 void test_visitVariableDeclarationList_var() {
1988 _assertClone( 1964 _assertClone(
1989 AstFactory.variableDeclarationList2( 1965 AstFactory.variableDeclarationList2(
1990 Keyword.VAR, 1966 Keyword.VAR,
1991 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")])); 1967 [AstFactory.variableDeclaration("a"), AstFactory.variableDeclaration ("b")]));
1992 } 1968 }
1993 1969
1994 void test_visitVariableDeclarationStatement() { 1970 void test_visitVariableDeclarationStatement() {
1995 _assertClone( 1971 _assertClone(
1996 AstFactory.variableDeclarationStatement( 1972 AstFactory.variableDeclarationStatement(
1997 null, 1973 null,
1998 AstFactory.typeName4("C", []), 1974 AstFactory.typeName4("C"),
1999 [AstFactory.variableDeclaration("c")])); 1975 [AstFactory.variableDeclaration("c")]));
2000 } 1976 }
2001 1977
2002 void test_visitVariableDeclaration_initialized() { 1978 void test_visitVariableDeclaration_initialized() {
2003 _assertClone( 1979 _assertClone(
2004 AstFactory.variableDeclaration2("a", AstFactory.identifier3("b"))); 1980 AstFactory.variableDeclaration2("a", AstFactory.identifier3("b")));
2005 } 1981 }
2006 1982
2007 void test_visitVariableDeclaration_uninitialized() { 1983 void test_visitVariableDeclaration_uninitialized() {
2008 _assertClone(AstFactory.variableDeclaration("a")); 1984 _assertClone(AstFactory.variableDeclaration("a"));
2009 } 1985 }
2010 1986
2011 void test_visitVariableDeclaration_withMetadata() { 1987 void test_visitVariableDeclaration_withMetadata() {
2012 VariableDeclaration declaration = AstFactory.variableDeclaration("a"); 1988 VariableDeclaration declaration = AstFactory.variableDeclaration("a");
2013 declaration.metadata = 1989 declaration.metadata =
2014 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("deprecate d"))]); 1990 [AstFactory.annotation(AstFactory.identifier3("deprecated"))];
2015 _assertClone(declaration); 1991 _assertClone(declaration);
2016 } 1992 }
2017 1993
2018 void test_visitWhileStatement() { 1994 void test_visitWhileStatement() {
2019 _assertClone( 1995 _assertClone(
2020 AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block( []))); 1996 AstFactory.whileStatement(AstFactory.identifier3("c"), AstFactory.block( )));
2021 } 1997 }
2022 1998
2023 void test_visitWithClause_multiple() { 1999 void test_visitWithClause_multiple() {
2024 _assertClone( 2000 _assertClone(
2025 AstFactory.withClause( 2001 AstFactory.withClause(
2026 [ 2002 [
2027 AstFactory.typeName4("A", []), 2003 AstFactory.typeName4("A"),
2028 AstFactory.typeName4("B", []), 2004 AstFactory.typeName4("B"),
2029 AstFactory.typeName4("C", [])])); 2005 AstFactory.typeName4("C")]));
2030 } 2006 }
2031 2007
2032 void test_visitWithClause_single() { 2008 void test_visitWithClause_single() {
2033 _assertClone(AstFactory.withClause([AstFactory.typeName4("A", [])])); 2009 _assertClone(AstFactory.withClause([AstFactory.typeName4("A")]));
2034 } 2010 }
2035 2011
2036 void test_visitYieldStatement() { 2012 void test_visitYieldStatement() {
2037 _assertClone(AstFactory.yieldStatement(AstFactory.identifier3("A"))); 2013 _assertClone(AstFactory.yieldStatement(AstFactory.identifier3("A")));
2038 } 2014 }
2039 2015
2040 /** 2016 /**
2041 * Assert that an `AstCloner` will produce the expected AST structure when 2017 * Assert that an `AstCloner` will produce the expected AST structure when
2042 * visiting the given [node]. 2018 * visiting the given [node].
2043 * 2019 *
(...skipping 1542 matching lines...) Expand 10 before | Expand all | Expand 10 after
3586 NodeReplacerTest_ListGetter<WithClause, TypeName> { 3562 NodeReplacerTest_ListGetter<WithClause, TypeName> {
3587 ListGetter_NodeReplacerTest_test_withClause(int arg0) : super(arg0); 3563 ListGetter_NodeReplacerTest_test_withClause(int arg0) : super(arg0);
3588 3564
3589 @override 3565 @override
3590 NodeList<TypeName> getList(WithClause node) => node.mixinTypes; 3566 NodeList<TypeName> getList(WithClause node) => node.mixinTypes;
3591 } 3567 }
3592 3568
3593 class ListUtilitiesTest { 3569 class ListUtilitiesTest {
3594 void test_addAll_emptyToEmpty() { 3570 void test_addAll_emptyToEmpty() {
3595 List<String> list = new List<String>(); 3571 List<String> list = new List<String>();
3596 List<String> elements = []; 3572 List<String> elements = <String>[];
3597 ListUtilities.addAll(list, elements); 3573 ListUtilities.addAll(list, elements);
3598 expect(list.length, 0); 3574 expect(list.length, 0);
3599 } 3575 }
3600 3576
3601 void test_addAll_emptyToNonEmpty() { 3577 void test_addAll_emptyToNonEmpty() {
3602 List<String> list = new List<String>(); 3578 List<String> list = new List<String>();
3603 list.add("a"); 3579 list.add("a");
3604 List<String> elements = []; 3580 List<String> elements = <String>[];
3605 ListUtilities.addAll(list, elements); 3581 ListUtilities.addAll(list, elements);
3606 expect(list.length, 1); 3582 expect(list.length, 1);
3607 } 3583 }
3608 3584
3609 void test_addAll_nonEmptyToEmpty() { 3585 void test_addAll_nonEmptyToEmpty() {
3610 List<String> list = new List<String>(); 3586 List<String> list = new List<String>();
3611 List<String> elements = ["b", "c"]; 3587 List<String> elements = ["b", "c"];
3612 ListUtilities.addAll(list, elements); 3588 ListUtilities.addAll(list, elements);
3613 expect(list.length, 2); 3589 expect(list.length, 2);
3614 } 3590 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
3733 expect(iterator.value, same(newValue)); 3709 expect(iterator.value, same(newValue));
3734 expect(iterator.moveNext(), isFalse); 3710 expect(iterator.moveNext(), isFalse);
3735 } 3711 }
3736 3712
3737 MultipleMapIterator<String, String> _iterator(List<Map> maps) { 3713 MultipleMapIterator<String, String> _iterator(List<Map> maps) {
3738 return new MultipleMapIterator<String, String>(maps); 3714 return new MultipleMapIterator<String, String>(maps);
3739 } 3715 }
3740 } 3716 }
3741 3717
3742 class NodeReplacerTest extends EngineTestCase { 3718 class NodeReplacerTest extends EngineTestCase {
3719 /**
3720 * An empty list of tokens.
3721 */
3722 static const List<Token> EMPTY_TOKEN_LIST = const <Token>[];
3723
3743 void test_adjacentStrings() { 3724 void test_adjacentStrings() {
3744 AdjacentStrings node = 3725 AdjacentStrings node =
3745 AstFactory.adjacentStrings([AstFactory.string2("a"), AstFactory.string2( "b")]); 3726 AstFactory.adjacentStrings([AstFactory.string2("a"), AstFactory.string2( "b")]);
3746 _assertReplace( 3727 _assertReplace(
3747 node, 3728 node,
3748 new ListGetter_NodeReplacerTest_test_adjacentStrings_2(0)); 3729 new ListGetter_NodeReplacerTest_test_adjacentStrings_2(0));
3749 _assertReplace( 3730 _assertReplace(
3750 node, 3731 node,
3751 new ListGetter_NodeReplacerTest_test_adjacentStrings(1)); 3732 new ListGetter_NodeReplacerTest_test_adjacentStrings(1));
3752 } 3733 }
(...skipping 11 matching lines...) Expand all
3764 void test_argumentList() { 3745 void test_argumentList() {
3765 ArgumentList node = AstFactory.argumentList([AstFactory.integer(0)]); 3746 ArgumentList node = AstFactory.argumentList([AstFactory.integer(0)]);
3766 _assertReplace(node, new ListGetter_NodeReplacerTest_test_argumentList(0)); 3747 _assertReplace(node, new ListGetter_NodeReplacerTest_test_argumentList(0));
3767 } 3748 }
3768 3749
3769 void test_asExpression() { 3750 void test_asExpression() {
3770 AsExpression node = AstFactory.asExpression( 3751 AsExpression node = AstFactory.asExpression(
3771 AstFactory.integer(0), 3752 AstFactory.integer(0),
3772 AstFactory.typeName3( 3753 AstFactory.typeName3(
3773 AstFactory.identifier3("a"), 3754 AstFactory.identifier3("a"),
3774 [AstFactory.typeName4("C", [])])); 3755 [AstFactory.typeName4("C")]));
3775 _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression_2()); 3756 _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression_2());
3776 _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression()); 3757 _assertReplace(node, new Getter_NodeReplacerTest_test_asExpression());
3777 } 3758 }
3778 3759
3779 void test_assertStatement() { 3760 void test_assertStatement() {
3780 AssertStatement node = 3761 AssertStatement node =
3781 AstFactory.assertStatement(AstFactory.booleanLiteral(true)); 3762 AstFactory.assertStatement(AstFactory.booleanLiteral(true));
3782 _assertReplace(node, new Getter_NodeReplacerTest_test_assertStatement()); 3763 _assertReplace(node, new Getter_NodeReplacerTest_test_assertStatement());
3783 } 3764 }
3784 3765
(...skipping 18 matching lines...) Expand all
3803 _assertReplace(node, new Getter_NodeReplacerTest_test_binaryExpression()); 3784 _assertReplace(node, new Getter_NodeReplacerTest_test_binaryExpression());
3804 _assertReplace(node, new Getter_NodeReplacerTest_test_binaryExpression_2()); 3785 _assertReplace(node, new Getter_NodeReplacerTest_test_binaryExpression_2());
3805 } 3786 }
3806 3787
3807 void test_block() { 3788 void test_block() {
3808 Block node = AstFactory.block([AstFactory.emptyStatement()]); 3789 Block node = AstFactory.block([AstFactory.emptyStatement()]);
3809 _assertReplace(node, new ListGetter_NodeReplacerTest_test_block(0)); 3790 _assertReplace(node, new ListGetter_NodeReplacerTest_test_block(0));
3810 } 3791 }
3811 3792
3812 void test_blockFunctionBody() { 3793 void test_blockFunctionBody() {
3813 BlockFunctionBody node = AstFactory.blockFunctionBody(AstFactory.block([])); 3794 BlockFunctionBody node = AstFactory.blockFunctionBody(AstFactory.block());
3814 _assertReplace(node, new Getter_NodeReplacerTest_test_blockFunctionBody()); 3795 _assertReplace(node, new Getter_NodeReplacerTest_test_blockFunctionBody());
3815 } 3796 }
3816 3797
3817 void test_breakStatement() { 3798 void test_breakStatement() {
3818 BreakStatement node = AstFactory.breakStatement2("l"); 3799 BreakStatement node = AstFactory.breakStatement2("l");
3819 _assertReplace(node, new Getter_NodeReplacerTest_test_breakStatement()); 3800 _assertReplace(node, new Getter_NodeReplacerTest_test_breakStatement());
3820 } 3801 }
3821 3802
3822 void test_cascadeExpression() { 3803 void test_cascadeExpression() {
3823 CascadeExpression node = AstFactory.cascadeExpression( 3804 CascadeExpression node = AstFactory.cascadeExpression(
3824 AstFactory.integer(0), 3805 AstFactory.integer(0),
3825 [AstFactory.propertyAccess(null, AstFactory.identifier3("b"))]); 3806 [AstFactory.propertyAccess(null, AstFactory.identifier3("b"))]);
3826 _assertReplace(node, new Getter_NodeReplacerTest_test_cascadeExpression()); 3807 _assertReplace(node, new Getter_NodeReplacerTest_test_cascadeExpression());
3827 _assertReplace( 3808 _assertReplace(
3828 node, 3809 node,
3829 new ListGetter_NodeReplacerTest_test_cascadeExpression(0)); 3810 new ListGetter_NodeReplacerTest_test_cascadeExpression(0));
3830 } 3811 }
3831 3812
3832 void test_catchClause() { 3813 void test_catchClause() {
3833 CatchClause node = AstFactory.catchClause5( 3814 CatchClause node = AstFactory.catchClause5(
3834 AstFactory.typeName4("E", []), 3815 AstFactory.typeName4("E"),
3835 "e", 3816 "e",
3836 "s", 3817 "s",
3837 [AstFactory.emptyStatement()]); 3818 [AstFactory.emptyStatement()]);
3838 _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause_3()); 3819 _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause_3());
3839 _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause_2()); 3820 _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause_2());
3840 _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause()); 3821 _assertReplace(node, new Getter_NodeReplacerTest_test_catchClause());
3841 } 3822 }
3842 3823
3843 void test_classDeclaration() { 3824 void test_classDeclaration() {
3844 ClassDeclaration node = AstFactory.classDeclaration( 3825 ClassDeclaration node = AstFactory.classDeclaration(
3845 null, 3826 null,
3846 "A", 3827 "A",
3847 AstFactory.typeParameterList(["E"]), 3828 AstFactory.typeParameterList(["E"]),
3848 AstFactory.extendsClause(AstFactory.typeName4("B", [])), 3829 AstFactory.extendsClause(AstFactory.typeName4("B")),
3849 AstFactory.withClause([AstFactory.typeName4("C", [])]), 3830 AstFactory.withClause([AstFactory.typeName4("C")]),
3850 AstFactory.implementsClause([AstFactory.typeName4("D", [])]), 3831 AstFactory.implementsClause([AstFactory.typeName4("D")]),
3851 [ 3832 [
3852 AstFactory.fieldDeclaration2( 3833 AstFactory.fieldDeclaration2(
3853 false, 3834 false,
3854 null, 3835 null,
3855 [AstFactory.variableDeclaration("f")])]); 3836 [AstFactory.variableDeclaration("f")])]);
3856 node.documentationComment = 3837 node.documentationComment =
3857 Comment.createEndOfLineComment(new List<Token>(0)); 3838 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
3858 node.metadata = 3839 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
3859 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
3860 node.nativeClause = AstFactory.nativeClause(""); 3840 node.nativeClause = AstFactory.nativeClause("");
3861 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_6()); 3841 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_6());
3862 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_5()); 3842 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_5());
3863 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_4()); 3843 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_4());
3864 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_2()); 3844 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_2());
3865 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration()); 3845 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration());
3866 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_3()); 3846 _assertReplace(node, new Getter_NodeReplacerTest_test_classDeclaration_3());
3867 _assertReplace( 3847 _assertReplace(
3868 node, 3848 node,
3869 new ListGetter_NodeReplacerTest_test_classDeclaration(0)); 3849 new ListGetter_NodeReplacerTest_test_classDeclaration(0));
3870 _testAnnotatedNode(node); 3850 _testAnnotatedNode(node);
3871 } 3851 }
3872 3852
3873 void test_classTypeAlias() { 3853 void test_classTypeAlias() {
3874 ClassTypeAlias node = AstFactory.classTypeAlias( 3854 ClassTypeAlias node = AstFactory.classTypeAlias(
3875 "A", 3855 "A",
3876 AstFactory.typeParameterList(["E"]), 3856 AstFactory.typeParameterList(["E"]),
3877 null, 3857 null,
3878 AstFactory.typeName4("B", []), 3858 AstFactory.typeName4("B"),
3879 AstFactory.withClause([AstFactory.typeName4("C", [])]), 3859 AstFactory.withClause([AstFactory.typeName4("C")]),
3880 AstFactory.implementsClause([AstFactory.typeName4("D", [])])); 3860 AstFactory.implementsClause([AstFactory.typeName4("D")]));
3881 node.documentationComment = 3861 node.documentationComment =
3882 Comment.createEndOfLineComment(new List<Token>(0)); 3862 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
3883 node.metadata = 3863 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
3884 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
3885 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_4()); 3864 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_4());
3886 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_5()); 3865 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_5());
3887 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias()); 3866 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias());
3888 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_3()); 3867 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_3());
3889 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_2()); 3868 _assertReplace(node, new Getter_NodeReplacerTest_test_classTypeAlias_2());
3890 _testAnnotatedNode(node); 3869 _testAnnotatedNode(node);
3891 } 3870 }
3892 3871
3893 void test_comment() { 3872 void test_comment() {
3894 Comment node = Comment.createEndOfLineComment(new List<Token>(0)); 3873 Comment node = Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
3895 node.references.add( 3874 node.references.add(
3896 new CommentReference(null, AstFactory.identifier3("x"))); 3875 new CommentReference(null, AstFactory.identifier3("x")));
3897 _assertReplace(node, new ListGetter_NodeReplacerTest_test_comment(0)); 3876 _assertReplace(node, new ListGetter_NodeReplacerTest_test_comment(0));
3898 } 3877 }
3899 3878
3900 void test_commentReference() { 3879 void test_commentReference() {
3901 CommentReference node = 3880 CommentReference node =
3902 new CommentReference(null, AstFactory.identifier3("x")); 3881 new CommentReference(null, AstFactory.identifier3("x"));
3903 _assertReplace(node, new Getter_NodeReplacerTest_test_commentReference()); 3882 _assertReplace(node, new Getter_NodeReplacerTest_test_commentReference());
3904 } 3883 }
3905 3884
3906 void test_compilationUnit() { 3885 void test_compilationUnit() {
3907 CompilationUnit node = AstFactory.compilationUnit8( 3886 CompilationUnit node = AstFactory.compilationUnit8(
3908 "", 3887 "",
3909 AstFactory.list([AstFactory.libraryDirective2("lib")]), 3888 [AstFactory.libraryDirective2("lib")],
3910 AstFactory.list( 3889 [AstFactory.topLevelVariableDeclaration2(
3911 [ 3890 null,
3912 AstFactory.topLevelVariableDeclaration2( 3891 [AstFactory.variableDeclaration("X")])]);
3913 null,
3914 [AstFactory.variableDeclaration("X")])]));
3915 _assertReplace(node, new Getter_NodeReplacerTest_test_compilationUnit()); 3892 _assertReplace(node, new Getter_NodeReplacerTest_test_compilationUnit());
3916 _assertReplace( 3893 _assertReplace(
3917 node, 3894 node,
3918 new ListGetter_NodeReplacerTest_test_compilationUnit(0)); 3895 new ListGetter_NodeReplacerTest_test_compilationUnit(0));
3919 _assertReplace( 3896 _assertReplace(
3920 node, 3897 node,
3921 new ListGetter_NodeReplacerTest_test_compilationUnit_2(0)); 3898 new ListGetter_NodeReplacerTest_test_compilationUnit_2(0));
3922 } 3899 }
3923 3900
3924 void test_conditionalExpression() { 3901 void test_conditionalExpression() {
(...skipping 11 matching lines...) Expand all
3936 node, 3913 node,
3937 new Getter_NodeReplacerTest_test_conditionalExpression()); 3914 new Getter_NodeReplacerTest_test_conditionalExpression());
3938 } 3915 }
3939 3916
3940 void test_constructorDeclaration() { 3917 void test_constructorDeclaration() {
3941 ConstructorDeclaration node = AstFactory.constructorDeclaration2( 3918 ConstructorDeclaration node = AstFactory.constructorDeclaration2(
3942 null, 3919 null,
3943 null, 3920 null,
3944 AstFactory.identifier3("C"), 3921 AstFactory.identifier3("C"),
3945 "d", 3922 "d",
3946 AstFactory.formalParameterList([]), 3923 AstFactory.formalParameterList(),
3947 AstFactory.list( 3924 [AstFactory.constructorFieldInitializer(false, "x", AstFactory.integer(0 ))],
3948 [AstFactory.constructorFieldInitializer(false, "x", AstFactory.integ er(0))]),
3949 AstFactory.emptyFunctionBody()); 3925 AstFactory.emptyFunctionBody());
3950 node.documentationComment = 3926 node.documentationComment =
3951 Comment.createEndOfLineComment(new List<Token>(0)); 3927 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
3952 node.metadata = 3928 node.metadata =
3953 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]); 3929 [AstFactory.annotation(AstFactory.identifier3("a"))];
3954 node.redirectedConstructor = 3930 node.redirectedConstructor =
3955 AstFactory.constructorName(AstFactory.typeName4("B", []), "a"); 3931 AstFactory.constructorName(AstFactory.typeName4("B"), "a");
3956 _assertReplace( 3932 _assertReplace(
3957 node, 3933 node,
3958 new Getter_NodeReplacerTest_test_constructorDeclaration_3()); 3934 new Getter_NodeReplacerTest_test_constructorDeclaration_3());
3959 _assertReplace( 3935 _assertReplace(
3960 node, 3936 node,
3961 new Getter_NodeReplacerTest_test_constructorDeclaration_2()); 3937 new Getter_NodeReplacerTest_test_constructorDeclaration_2());
3962 _assertReplace( 3938 _assertReplace(
3963 node, 3939 node,
3964 new Getter_NodeReplacerTest_test_constructorDeclaration_4()); 3940 new Getter_NodeReplacerTest_test_constructorDeclaration_4());
3965 _assertReplace( 3941 _assertReplace(
(...skipping 14 matching lines...) Expand all
3980 _assertReplace( 3956 _assertReplace(
3981 node, 3957 node,
3982 new Getter_NodeReplacerTest_test_constructorFieldInitializer()); 3958 new Getter_NodeReplacerTest_test_constructorFieldInitializer());
3983 _assertReplace( 3959 _assertReplace(
3984 node, 3960 node,
3985 new Getter_NodeReplacerTest_test_constructorFieldInitializer_2()); 3961 new Getter_NodeReplacerTest_test_constructorFieldInitializer_2());
3986 } 3962 }
3987 3963
3988 void test_constructorName() { 3964 void test_constructorName() {
3989 ConstructorName node = 3965 ConstructorName node =
3990 AstFactory.constructorName(AstFactory.typeName4("C", []), "n"); 3966 AstFactory.constructorName(AstFactory.typeName4("C"), "n");
3991 _assertReplace(node, new Getter_NodeReplacerTest_test_constructorName()); 3967 _assertReplace(node, new Getter_NodeReplacerTest_test_constructorName());
3992 _assertReplace(node, new Getter_NodeReplacerTest_test_constructorName_2()); 3968 _assertReplace(node, new Getter_NodeReplacerTest_test_constructorName_2());
3993 } 3969 }
3994 3970
3995 void test_continueStatement() { 3971 void test_continueStatement() {
3996 ContinueStatement node = AstFactory.continueStatement("l"); 3972 ContinueStatement node = AstFactory.continueStatement("l");
3997 _assertReplace(node, new Getter_NodeReplacerTest_test_continueStatement()); 3973 _assertReplace(node, new Getter_NodeReplacerTest_test_continueStatement());
3998 } 3974 }
3999 3975
4000 void test_declaredIdentifier() { 3976 void test_declaredIdentifier() {
4001 DeclaredIdentifier node = 3977 DeclaredIdentifier node =
4002 AstFactory.declaredIdentifier4(AstFactory.typeName4("C", []), "i"); 3978 AstFactory.declaredIdentifier4(AstFactory.typeName4("C"), "i");
4003 node.documentationComment = 3979 node.documentationComment =
4004 Comment.createEndOfLineComment(new List<Token>(0)); 3980 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4005 node.metadata = 3981 node.metadata =
4006 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]); 3982 [AstFactory.annotation(AstFactory.identifier3("a"))];
4007 _assertReplace(node, new Getter_NodeReplacerTest_test_declaredIdentifier()); 3983 _assertReplace(node, new Getter_NodeReplacerTest_test_declaredIdentifier());
4008 _assertReplace( 3984 _assertReplace(
4009 node, 3985 node,
4010 new Getter_NodeReplacerTest_test_declaredIdentifier_2()); 3986 new Getter_NodeReplacerTest_test_declaredIdentifier_2());
4011 _testAnnotatedNode(node); 3987 _testAnnotatedNode(node);
4012 } 3988 }
4013 3989
4014 void test_defaultFormalParameter() { 3990 void test_defaultFormalParameter() {
4015 DefaultFormalParameter node = AstFactory.positionalFormalParameter( 3991 DefaultFormalParameter node = AstFactory.positionalFormalParameter(
4016 AstFactory.simpleFormalParameter3("p"), 3992 AstFactory.simpleFormalParameter3("p"),
4017 AstFactory.integer(0)); 3993 AstFactory.integer(0));
4018 _assertReplace( 3994 _assertReplace(
4019 node, 3995 node,
4020 new Getter_NodeReplacerTest_test_defaultFormalParameter()); 3996 new Getter_NodeReplacerTest_test_defaultFormalParameter());
4021 _assertReplace( 3997 _assertReplace(
4022 node, 3998 node,
4023 new Getter_NodeReplacerTest_test_defaultFormalParameter_2()); 3999 new Getter_NodeReplacerTest_test_defaultFormalParameter_2());
4024 } 4000 }
4025 4001
4026 void test_doStatement() { 4002 void test_doStatement() {
4027 DoStatement node = 4003 DoStatement node =
4028 AstFactory.doStatement(AstFactory.block([]), AstFactory.booleanLiteral(t rue)); 4004 AstFactory.doStatement(AstFactory.block(), AstFactory.booleanLiteral(tru e));
4029 _assertReplace(node, new Getter_NodeReplacerTest_test_doStatement_2()); 4005 _assertReplace(node, new Getter_NodeReplacerTest_test_doStatement_2());
4030 _assertReplace(node, new Getter_NodeReplacerTest_test_doStatement()); 4006 _assertReplace(node, new Getter_NodeReplacerTest_test_doStatement());
4031 } 4007 }
4032 4008
4033 void test_enumConstantDeclaration() { 4009 void test_enumConstantDeclaration() {
4034 EnumConstantDeclaration node = new EnumConstantDeclaration( 4010 EnumConstantDeclaration node = new EnumConstantDeclaration(
4035 Comment.createEndOfLineComment(new List<Token>(0)), 4011 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST),
4036 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]), 4012 [AstFactory.annotation(AstFactory.identifier3("a"))],
4037 AstFactory.identifier3("C")); 4013 AstFactory.identifier3("C"));
4038 _assertReplace( 4014 _assertReplace(
4039 node, 4015 node,
4040 new Getter_NodeReplacerTest_test_enumConstantDeclaration()); 4016 new Getter_NodeReplacerTest_test_enumConstantDeclaration());
4041 _testAnnotatedNode(node); 4017 _testAnnotatedNode(node);
4042 } 4018 }
4043 4019
4044 void test_enumDeclaration() { 4020 void test_enumDeclaration() {
4045 EnumDeclaration node = AstFactory.enumDeclaration2("E", ["ONE", "TWO"]); 4021 EnumDeclaration node = AstFactory.enumDeclaration2("E", ["ONE", "TWO"]);
4046 node.documentationComment = 4022 node.documentationComment
4047 Comment.createEndOfLineComment(new List<Token>(0)); 4023 = Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4048 node.metadata = 4024 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4049 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4050 _assertReplace(node, new Getter_NodeReplacerTest_test_enumDeclaration()); 4025 _assertReplace(node, new Getter_NodeReplacerTest_test_enumDeclaration());
4051 _testAnnotatedNode(node); 4026 _testAnnotatedNode(node);
4052 } 4027 }
4053 4028
4054 void test_exportDirective() { 4029 void test_exportDirective() {
4055 ExportDirective node = 4030 ExportDirective node =
4056 AstFactory.exportDirective2("", [AstFactory.hideCombinator2(["C"])]); 4031 AstFactory.exportDirective2("", [AstFactory.hideCombinator2(["C"])]);
4057 node.documentationComment = 4032 node.documentationComment =
4058 Comment.createEndOfLineComment(new List<Token>(0)); 4033 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4059 node.metadata = 4034 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4060 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4061 _testNamespaceDirective(node); 4035 _testNamespaceDirective(node);
4062 } 4036 }
4063 4037
4064 void test_expressionFunctionBody() { 4038 void test_expressionFunctionBody() {
4065 ExpressionFunctionBody node = 4039 ExpressionFunctionBody node =
4066 AstFactory.expressionFunctionBody(AstFactory.integer(0)); 4040 AstFactory.expressionFunctionBody(AstFactory.integer(0));
4067 _assertReplace( 4041 _assertReplace(
4068 node, 4042 node,
4069 new Getter_NodeReplacerTest_test_expressionFunctionBody()); 4043 new Getter_NodeReplacerTest_test_expressionFunctionBody());
4070 } 4044 }
4071 4045
4072 void test_expressionStatement() { 4046 void test_expressionStatement() {
4073 ExpressionStatement node = 4047 ExpressionStatement node =
4074 AstFactory.expressionStatement(AstFactory.integer(0)); 4048 AstFactory.expressionStatement(AstFactory.integer(0));
4075 _assertReplace( 4049 _assertReplace(
4076 node, 4050 node,
4077 new Getter_NodeReplacerTest_test_expressionStatement()); 4051 new Getter_NodeReplacerTest_test_expressionStatement());
4078 } 4052 }
4079 4053
4080 void test_extendsClause() { 4054 void test_extendsClause() {
4081 ExtendsClause node = 4055 ExtendsClause node =
4082 AstFactory.extendsClause(AstFactory.typeName4("S", [])); 4056 AstFactory.extendsClause(AstFactory.typeName4("S"));
4083 _assertReplace(node, new Getter_NodeReplacerTest_test_extendsClause()); 4057 _assertReplace(node, new Getter_NodeReplacerTest_test_extendsClause());
4084 } 4058 }
4085 4059
4086 void test_fieldDeclaration() { 4060 void test_fieldDeclaration() {
4087 FieldDeclaration node = AstFactory.fieldDeclaration( 4061 FieldDeclaration node = AstFactory.fieldDeclaration(
4088 false, 4062 false,
4089 null, 4063 null,
4090 AstFactory.typeName4("C", []), 4064 AstFactory.typeName4("C"),
4091 [AstFactory.variableDeclaration("c")]); 4065 [AstFactory.variableDeclaration("c")]);
4092 node.documentationComment = 4066 node.documentationComment =
4093 Comment.createEndOfLineComment(new List<Token>(0)); 4067 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4094 node.metadata = 4068 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4095 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4096 _assertReplace(node, new Getter_NodeReplacerTest_test_fieldDeclaration()); 4069 _assertReplace(node, new Getter_NodeReplacerTest_test_fieldDeclaration());
4097 _testAnnotatedNode(node); 4070 _testAnnotatedNode(node);
4098 } 4071 }
4099 4072
4100 void test_fieldFormalParameter() { 4073 void test_fieldFormalParameter() {
4101 FieldFormalParameter node = AstFactory.fieldFormalParameter( 4074 FieldFormalParameter node = AstFactory.fieldFormalParameter(
4102 null, 4075 null,
4103 AstFactory.typeName4("C", []), 4076 AstFactory.typeName4("C"),
4104 "f", 4077 "f",
4105 AstFactory.formalParameterList([])); 4078 AstFactory.formalParameterList());
4106 node.documentationComment = 4079 node.documentationComment =
4107 Comment.createEndOfLineComment(new List<Token>(0)); 4080 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4108 node.metadata = 4081 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4109 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4110 _assertReplace( 4082 _assertReplace(
4111 node, 4083 node,
4112 new Getter_NodeReplacerTest_test_fieldFormalParameter_2()); 4084 new Getter_NodeReplacerTest_test_fieldFormalParameter_2());
4113 _assertReplace( 4085 _assertReplace(
4114 node, 4086 node,
4115 new Getter_NodeReplacerTest_test_fieldFormalParameter()); 4087 new Getter_NodeReplacerTest_test_fieldFormalParameter());
4116 _testNormalFormalParameter(node); 4088 _testNormalFormalParameter(node);
4117 } 4089 }
4118 4090
4119 void test_forEachStatement_withIdentifier() { 4091 void test_forEachStatement_withIdentifier() {
4120 ForEachStatement node = AstFactory.forEachStatement2( 4092 ForEachStatement node = AstFactory.forEachStatement2(
4121 AstFactory.identifier3("i"), 4093 AstFactory.identifier3("i"),
4122 AstFactory.identifier3("l"), 4094 AstFactory.identifier3("l"),
4123 AstFactory.block([])); 4095 AstFactory.block());
4124 _assertReplace( 4096 _assertReplace(
4125 node, 4097 node,
4126 new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier_2()); 4098 new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier_2());
4127 _assertReplace( 4099 _assertReplace(
4128 node, 4100 node,
4129 new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier_3()); 4101 new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier_3());
4130 _assertReplace( 4102 _assertReplace(
4131 node, 4103 node,
4132 new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier()); 4104 new Getter_NodeReplacerTest_test_forEachStatement_withIdentifier());
4133 } 4105 }
4134 4106
4135 void test_forEachStatement_withLoopVariable() { 4107 void test_forEachStatement_withLoopVariable() {
4136 ForEachStatement node = AstFactory.forEachStatement( 4108 ForEachStatement node = AstFactory.forEachStatement(
4137 AstFactory.declaredIdentifier3("e"), 4109 AstFactory.declaredIdentifier3("e"),
4138 AstFactory.identifier3("l"), 4110 AstFactory.identifier3("l"),
4139 AstFactory.block([])); 4111 AstFactory.block());
4140 _assertReplace( 4112 _assertReplace(
4141 node, 4113 node,
4142 new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable_2()); 4114 new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable_2());
4143 _assertReplace( 4115 _assertReplace(
4144 node, 4116 node,
4145 new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable()); 4117 new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable());
4146 _assertReplace( 4118 _assertReplace(
4147 node, 4119 node,
4148 new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable_3()); 4120 new Getter_NodeReplacerTest_test_forEachStatement_withLoopVariable_3());
4149 } 4121 }
4150 4122
4151 void test_forStatement_withInitialization() { 4123 void test_forStatement_withInitialization() {
4152 ForStatement node = AstFactory.forStatement( 4124 ForStatement node = AstFactory.forStatement(
4153 AstFactory.identifier3("a"), 4125 AstFactory.identifier3("a"),
4154 AstFactory.booleanLiteral(true), 4126 AstFactory.booleanLiteral(true),
4155 AstFactory.list([AstFactory.integer(0)]), 4127 [AstFactory.integer(0)],
4156 AstFactory.block([])); 4128 AstFactory.block());
4157 _assertReplace( 4129 _assertReplace(
4158 node, 4130 node,
4159 new Getter_NodeReplacerTest_test_forStatement_withInitialization_3()); 4131 new Getter_NodeReplacerTest_test_forStatement_withInitialization_3());
4160 _assertReplace( 4132 _assertReplace(
4161 node, 4133 node,
4162 new Getter_NodeReplacerTest_test_forStatement_withInitialization_2()); 4134 new Getter_NodeReplacerTest_test_forStatement_withInitialization_2());
4163 _assertReplace( 4135 _assertReplace(
4164 node, 4136 node,
4165 new Getter_NodeReplacerTest_test_forStatement_withInitialization()); 4137 new Getter_NodeReplacerTest_test_forStatement_withInitialization());
4166 _assertReplace( 4138 _assertReplace(
4167 node, 4139 node,
4168 new ListGetter_NodeReplacerTest_test_forStatement_withInitialization(0)) ; 4140 new ListGetter_NodeReplacerTest_test_forStatement_withInitialization(0)) ;
4169 } 4141 }
4170 4142
4171 void test_forStatement_withVariables() { 4143 void test_forStatement_withVariables() {
4172 ForStatement node = AstFactory.forStatement2( 4144 ForStatement node = AstFactory.forStatement2(
4173 AstFactory.variableDeclarationList2( 4145 AstFactory.variableDeclarationList2(
4174 null, 4146 null,
4175 [AstFactory.variableDeclaration("i")]), 4147 [AstFactory.variableDeclaration("i")]),
4176 AstFactory.booleanLiteral(true), 4148 AstFactory.booleanLiteral(true),
4177 AstFactory.list([AstFactory.integer(0)]), 4149 [AstFactory.integer(0)],
4178 AstFactory.block([])); 4150 AstFactory.block());
4179 _assertReplace( 4151 _assertReplace(
4180 node, 4152 node,
4181 new Getter_NodeReplacerTest_test_forStatement_withVariables_2()); 4153 new Getter_NodeReplacerTest_test_forStatement_withVariables_2());
4182 _assertReplace( 4154 _assertReplace(
4183 node, 4155 node,
4184 new Getter_NodeReplacerTest_test_forStatement_withVariables_3()); 4156 new Getter_NodeReplacerTest_test_forStatement_withVariables_3());
4185 _assertReplace( 4157 _assertReplace(
4186 node, 4158 node,
4187 new Getter_NodeReplacerTest_test_forStatement_withVariables()); 4159 new Getter_NodeReplacerTest_test_forStatement_withVariables());
4188 _assertReplace( 4160 _assertReplace(
4189 node, 4161 node,
4190 new ListGetter_NodeReplacerTest_test_forStatement_withVariables(0)); 4162 new ListGetter_NodeReplacerTest_test_forStatement_withVariables(0));
4191 } 4163 }
4192 4164
4193 void test_formalParameterList() { 4165 void test_formalParameterList() {
4194 FormalParameterList node = 4166 FormalParameterList node =
4195 AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("p")]) ; 4167 AstFactory.formalParameterList([AstFactory.simpleFormalParameter3("p")]) ;
4196 _assertReplace( 4168 _assertReplace(
4197 node, 4169 node,
4198 new ListGetter_NodeReplacerTest_test_formalParameterList(0)); 4170 new ListGetter_NodeReplacerTest_test_formalParameterList(0));
4199 } 4171 }
4200 4172
4201 void test_functionDeclaration() { 4173 void test_functionDeclaration() {
4202 FunctionDeclaration node = AstFactory.functionDeclaration( 4174 FunctionDeclaration node = AstFactory.functionDeclaration(
4203 AstFactory.typeName4("R", []), 4175 AstFactory.typeName4("R"),
4204 null, 4176 null,
4205 "f", 4177 "f",
4206 AstFactory.functionExpression2( 4178 AstFactory.functionExpression2(
4207 AstFactory.formalParameterList([]), 4179 AstFactory.formalParameterList(),
4208 AstFactory.blockFunctionBody(AstFactory.block([])))); 4180 AstFactory.blockFunctionBody(AstFactory.block())));
4209 node.documentationComment = 4181 node.documentationComment =
4210 Comment.createEndOfLineComment(new List<Token>(0)); 4182 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4211 node.metadata = 4183 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4212 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4213 _assertReplace( 4184 _assertReplace(
4214 node, 4185 node,
4215 new Getter_NodeReplacerTest_test_functionDeclaration()); 4186 new Getter_NodeReplacerTest_test_functionDeclaration());
4216 _assertReplace( 4187 _assertReplace(
4217 node, 4188 node,
4218 new Getter_NodeReplacerTest_test_functionDeclaration_3()); 4189 new Getter_NodeReplacerTest_test_functionDeclaration_3());
4219 _assertReplace( 4190 _assertReplace(
4220 node, 4191 node,
4221 new Getter_NodeReplacerTest_test_functionDeclaration_2()); 4192 new Getter_NodeReplacerTest_test_functionDeclaration_2());
4222 _testAnnotatedNode(node); 4193 _testAnnotatedNode(node);
4223 } 4194 }
4224 4195
4225 void test_functionDeclarationStatement() { 4196 void test_functionDeclarationStatement() {
4226 FunctionDeclarationStatement node = AstFactory.functionDeclarationStatement( 4197 FunctionDeclarationStatement node = AstFactory.functionDeclarationStatement(
4227 AstFactory.typeName4("R", []), 4198 AstFactory.typeName4("R"),
4228 null, 4199 null,
4229 "f", 4200 "f",
4230 AstFactory.functionExpression2( 4201 AstFactory.functionExpression2(
4231 AstFactory.formalParameterList([]), 4202 AstFactory.formalParameterList(),
4232 AstFactory.blockFunctionBody(AstFactory.block([])))); 4203 AstFactory.blockFunctionBody(AstFactory.block())));
4233 _assertReplace( 4204 _assertReplace(
4234 node, 4205 node,
4235 new Getter_NodeReplacerTest_test_functionDeclarationStatement()); 4206 new Getter_NodeReplacerTest_test_functionDeclarationStatement());
4236 } 4207 }
4237 4208
4238 void test_functionExpression() { 4209 void test_functionExpression() {
4239 FunctionExpression node = AstFactory.functionExpression2( 4210 FunctionExpression node = AstFactory.functionExpression2(
4240 AstFactory.formalParameterList([]), 4211 AstFactory.formalParameterList(),
4241 AstFactory.blockFunctionBody(AstFactory.block([]))); 4212 AstFactory.blockFunctionBody(AstFactory.block()));
4242 _assertReplace(node, new Getter_NodeReplacerTest_test_functionExpression()); 4213 _assertReplace(node, new Getter_NodeReplacerTest_test_functionExpression());
4243 _assertReplace( 4214 _assertReplace(
4244 node, 4215 node,
4245 new Getter_NodeReplacerTest_test_functionExpression_2()); 4216 new Getter_NodeReplacerTest_test_functionExpression_2());
4246 } 4217 }
4247 4218
4248 void test_functionExpressionInvocation() { 4219 void test_functionExpressionInvocation() {
4249 FunctionExpressionInvocation node = AstFactory.functionExpressionInvocation( 4220 FunctionExpressionInvocation node = AstFactory.functionExpressionInvocation(
4250 AstFactory.identifier3("f"), 4221 AstFactory.identifier3("f"),
4251 [AstFactory.integer(0)]); 4222 [AstFactory.integer(0)]);
4252 _assertReplace( 4223 _assertReplace(
4253 node, 4224 node,
4254 new Getter_NodeReplacerTest_test_functionExpressionInvocation()); 4225 new Getter_NodeReplacerTest_test_functionExpressionInvocation());
4255 _assertReplace( 4226 _assertReplace(
4256 node, 4227 node,
4257 new Getter_NodeReplacerTest_test_functionExpressionInvocation_2()); 4228 new Getter_NodeReplacerTest_test_functionExpressionInvocation_2());
4258 } 4229 }
4259 4230
4260 void test_functionTypeAlias() { 4231 void test_functionTypeAlias() {
4261 FunctionTypeAlias node = AstFactory.typeAlias( 4232 FunctionTypeAlias node = AstFactory.typeAlias(
4262 AstFactory.typeName4("R", []), 4233 AstFactory.typeName4("R"),
4263 "F", 4234 "F",
4264 AstFactory.typeParameterList(["E"]), 4235 AstFactory.typeParameterList(["E"]),
4265 AstFactory.formalParameterList([])); 4236 AstFactory.formalParameterList());
4266 node.documentationComment = 4237 node.documentationComment =
4267 Comment.createEndOfLineComment(new List<Token>(0)); 4238 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4268 node.metadata = 4239 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4269 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4270 _assertReplace( 4240 _assertReplace(
4271 node, 4241 node,
4272 new Getter_NodeReplacerTest_test_functionTypeAlias_3()); 4242 new Getter_NodeReplacerTest_test_functionTypeAlias_3());
4273 _assertReplace( 4243 _assertReplace(
4274 node, 4244 node,
4275 new Getter_NodeReplacerTest_test_functionTypeAlias_4()); 4245 new Getter_NodeReplacerTest_test_functionTypeAlias_4());
4276 _assertReplace(node, new Getter_NodeReplacerTest_test_functionTypeAlias()); 4246 _assertReplace(node, new Getter_NodeReplacerTest_test_functionTypeAlias());
4277 _assertReplace( 4247 _assertReplace(
4278 node, 4248 node,
4279 new Getter_NodeReplacerTest_test_functionTypeAlias_2()); 4249 new Getter_NodeReplacerTest_test_functionTypeAlias_2());
4280 _testAnnotatedNode(node); 4250 _testAnnotatedNode(node);
4281 } 4251 }
4282 4252
4283 void test_functionTypedFormalParameter() { 4253 void test_functionTypedFormalParameter() {
4284 FunctionTypedFormalParameter node = AstFactory.functionTypedFormalParameter( 4254 FunctionTypedFormalParameter node = AstFactory.functionTypedFormalParameter(
4285 AstFactory.typeName4("R", []), 4255 AstFactory.typeName4("R"),
4286 "f", 4256 "f",
4287 [AstFactory.simpleFormalParameter3("p")]); 4257 [AstFactory.simpleFormalParameter3("p")]);
4288 node.documentationComment = 4258 node.documentationComment =
4289 Comment.createEndOfLineComment(new List<Token>(0)); 4259 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4290 node.metadata = 4260 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4291 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4292 _assertReplace( 4261 _assertReplace(
4293 node, 4262 node,
4294 new Getter_NodeReplacerTest_test_functionTypedFormalParameter()); 4263 new Getter_NodeReplacerTest_test_functionTypedFormalParameter());
4295 _assertReplace( 4264 _assertReplace(
4296 node, 4265 node,
4297 new Getter_NodeReplacerTest_test_functionTypedFormalParameter_2()); 4266 new Getter_NodeReplacerTest_test_functionTypedFormalParameter_2());
4298 _testNormalFormalParameter(node); 4267 _testNormalFormalParameter(node);
4299 } 4268 }
4300 4269
4301 void test_hideCombinator() { 4270 void test_hideCombinator() {
4302 HideCombinator node = AstFactory.hideCombinator2(["A", "B"]); 4271 HideCombinator node = AstFactory.hideCombinator2(["A", "B"]);
4303 _assertReplace( 4272 _assertReplace(
4304 node, 4273 node,
4305 new ListGetter_NodeReplacerTest_test_hideCombinator(0)); 4274 new ListGetter_NodeReplacerTest_test_hideCombinator(0));
4306 } 4275 }
4307 4276
4308 void test_ifStatement() { 4277 void test_ifStatement() {
4309 IfStatement node = AstFactory.ifStatement2( 4278 IfStatement node = AstFactory.ifStatement2(
4310 AstFactory.booleanLiteral(true), 4279 AstFactory.booleanLiteral(true),
4311 AstFactory.block([]), 4280 AstFactory.block(),
4312 AstFactory.block([])); 4281 AstFactory.block());
4313 _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement()); 4282 _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement());
4314 _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement_3()); 4283 _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement_3());
4315 _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement_2()); 4284 _assertReplace(node, new Getter_NodeReplacerTest_test_ifStatement_2());
4316 } 4285 }
4317 4286
4318 void test_implementsClause() { 4287 void test_implementsClause() {
4319 ImplementsClause node = AstFactory.implementsClause( 4288 ImplementsClause node = AstFactory.implementsClause(
4320 [AstFactory.typeName4("I", []), AstFactory.typeName4("J", [])]); 4289 [AstFactory.typeName4("I"), AstFactory.typeName4("J")]);
4321 _assertReplace( 4290 _assertReplace(
4322 node, 4291 node,
4323 new ListGetter_NodeReplacerTest_test_implementsClause(0)); 4292 new ListGetter_NodeReplacerTest_test_implementsClause(0));
4324 } 4293 }
4325 4294
4326 void test_importDirective() { 4295 void test_importDirective() {
4327 ImportDirective node = AstFactory.importDirective3( 4296 ImportDirective node = AstFactory.importDirective3(
4328 "", 4297 "",
4329 "p", 4298 "p",
4330 [AstFactory.showCombinator2(["A"]), AstFactory.hideCombinator2(["B"])]); 4299 [AstFactory.showCombinator2(["A"]), AstFactory.hideCombinator2(["B"])]);
4331 node.documentationComment = 4300 node.documentationComment =
4332 Comment.createEndOfLineComment(new List<Token>(0)); 4301 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4333 node.metadata = 4302 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4334 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4335 _assertReplace(node, new Getter_NodeReplacerTest_test_importDirective()); 4303 _assertReplace(node, new Getter_NodeReplacerTest_test_importDirective());
4336 _testNamespaceDirective(node); 4304 _testNamespaceDirective(node);
4337 } 4305 }
4338 4306
4339 void test_indexExpression() { 4307 void test_indexExpression() {
4340 IndexExpression node = AstFactory.indexExpression( 4308 IndexExpression node = AstFactory.indexExpression(
4341 AstFactory.identifier3("a"), 4309 AstFactory.identifier3("a"),
4342 AstFactory.identifier3("i")); 4310 AstFactory.identifier3("i"));
4343 _assertReplace(node, new Getter_NodeReplacerTest_test_indexExpression()); 4311 _assertReplace(node, new Getter_NodeReplacerTest_test_indexExpression());
4344 _assertReplace(node, new Getter_NodeReplacerTest_test_indexExpression_2()); 4312 _assertReplace(node, new Getter_NodeReplacerTest_test_indexExpression_2());
4345 } 4313 }
4346 4314
4347 void test_instanceCreationExpression() { 4315 void test_instanceCreationExpression() {
4348 InstanceCreationExpression node = AstFactory.instanceCreationExpression3( 4316 InstanceCreationExpression node = AstFactory.instanceCreationExpression3(
4349 null, 4317 null,
4350 AstFactory.typeName4("C", []), 4318 AstFactory.typeName4("C"),
4351 "c", 4319 "c",
4352 [AstFactory.integer(2)]); 4320 [AstFactory.integer(2)]);
4353 _assertReplace( 4321 _assertReplace(
4354 node, 4322 node,
4355 new Getter_NodeReplacerTest_test_instanceCreationExpression_2()); 4323 new Getter_NodeReplacerTest_test_instanceCreationExpression_2());
4356 _assertReplace( 4324 _assertReplace(
4357 node, 4325 node,
4358 new Getter_NodeReplacerTest_test_instanceCreationExpression()); 4326 new Getter_NodeReplacerTest_test_instanceCreationExpression());
4359 } 4327 }
4360 4328
4361 void test_interpolationExpression() { 4329 void test_interpolationExpression() {
4362 InterpolationExpression node = AstFactory.interpolationExpression2("x"); 4330 InterpolationExpression node = AstFactory.interpolationExpression2("x");
4363 _assertReplace( 4331 _assertReplace(
4364 node, 4332 node,
4365 new Getter_NodeReplacerTest_test_interpolationExpression()); 4333 new Getter_NodeReplacerTest_test_interpolationExpression());
4366 } 4334 }
4367 4335
4368 void test_isExpression() { 4336 void test_isExpression() {
4369 IsExpression node = AstFactory.isExpression( 4337 IsExpression node = AstFactory.isExpression(
4370 AstFactory.identifier3("v"), 4338 AstFactory.identifier3("v"),
4371 false, 4339 false,
4372 AstFactory.typeName4("T", [])); 4340 AstFactory.typeName4("T"));
4373 _assertReplace(node, new Getter_NodeReplacerTest_test_isExpression()); 4341 _assertReplace(node, new Getter_NodeReplacerTest_test_isExpression());
4374 _assertReplace(node, new Getter_NodeReplacerTest_test_isExpression_2()); 4342 _assertReplace(node, new Getter_NodeReplacerTest_test_isExpression_2());
4375 } 4343 }
4376 4344
4377 void test_label() { 4345 void test_label() {
4378 Label node = AstFactory.label2("l"); 4346 Label node = AstFactory.label2("l");
4379 _assertReplace(node, new Getter_NodeReplacerTest_test_label()); 4347 _assertReplace(node, new Getter_NodeReplacerTest_test_label());
4380 } 4348 }
4381 4349
4382 void test_labeledStatement() { 4350 void test_labeledStatement() {
4383 LabeledStatement node = AstFactory.labeledStatement( 4351 LabeledStatement node = AstFactory.labeledStatement(
4384 AstFactory.list([AstFactory.label2("l")]), 4352 [AstFactory.label2("l")],
4385 AstFactory.block([])); 4353 AstFactory.block());
4386 _assertReplace( 4354 _assertReplace(
4387 node, 4355 node,
4388 new ListGetter_NodeReplacerTest_test_labeledStatement(0)); 4356 new ListGetter_NodeReplacerTest_test_labeledStatement(0));
4389 _assertReplace(node, new Getter_NodeReplacerTest_test_labeledStatement()); 4357 _assertReplace(node, new Getter_NodeReplacerTest_test_labeledStatement());
4390 } 4358 }
4391 4359
4392 void test_libraryDirective() { 4360 void test_libraryDirective() {
4393 LibraryDirective node = AstFactory.libraryDirective2("lib"); 4361 LibraryDirective node = AstFactory.libraryDirective2("lib");
4394 node.documentationComment = 4362 node.documentationComment =
4395 Comment.createEndOfLineComment(new List<Token>(0)); 4363 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4396 node.metadata = 4364 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4397 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4398 _assertReplace(node, new Getter_NodeReplacerTest_test_libraryDirective()); 4365 _assertReplace(node, new Getter_NodeReplacerTest_test_libraryDirective());
4399 _testAnnotatedNode(node); 4366 _testAnnotatedNode(node);
4400 } 4367 }
4401 4368
4402 void test_libraryIdentifier() { 4369 void test_libraryIdentifier() {
4403 LibraryIdentifier node = AstFactory.libraryIdentifier2(["lib"]); 4370 LibraryIdentifier node = AstFactory.libraryIdentifier2(["lib"]);
4404 _assertReplace( 4371 _assertReplace(
4405 node, 4372 node,
4406 new ListGetter_NodeReplacerTest_test_libraryIdentifier(0)); 4373 new ListGetter_NodeReplacerTest_test_libraryIdentifier(0));
4407 } 4374 }
4408 4375
4409 void test_listLiteral() { 4376 void test_listLiteral() {
4410 ListLiteral node = AstFactory.listLiteral2( 4377 ListLiteral node = AstFactory.listLiteral2(
4411 null, 4378 null,
4412 AstFactory.typeArgumentList([AstFactory.typeName4("E", [])]), 4379 AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
4413 [AstFactory.identifier3("e")]); 4380 [AstFactory.identifier3("e")]);
4414 _assertReplace(node, new ListGetter_NodeReplacerTest_test_listLiteral(0)); 4381 _assertReplace(node, new ListGetter_NodeReplacerTest_test_listLiteral(0));
4415 _testTypedLiteral(node); 4382 _testTypedLiteral(node);
4416 } 4383 }
4417 4384
4418 void test_mapLiteral() { 4385 void test_mapLiteral() {
4419 MapLiteral node = AstFactory.mapLiteral( 4386 MapLiteral node = AstFactory.mapLiteral(
4420 null, 4387 null,
4421 AstFactory.typeArgumentList([AstFactory.typeName4("E", [])]), 4388 AstFactory.typeArgumentList([AstFactory.typeName4("E")]),
4422 [AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"))]); 4389 [AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"))]);
4423 _assertReplace(node, new ListGetter_NodeReplacerTest_test_mapLiteral(0)); 4390 _assertReplace(node, new ListGetter_NodeReplacerTest_test_mapLiteral(0));
4424 _testTypedLiteral(node); 4391 _testTypedLiteral(node);
4425 } 4392 }
4426 4393
4427 void test_mapLiteralEntry() { 4394 void test_mapLiteralEntry() {
4428 MapLiteralEntry node = 4395 MapLiteralEntry node =
4429 AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v")); 4396 AstFactory.mapLiteralEntry("k", AstFactory.identifier3("v"));
4430 _assertReplace(node, new Getter_NodeReplacerTest_test_mapLiteralEntry_2()); 4397 _assertReplace(node, new Getter_NodeReplacerTest_test_mapLiteralEntry_2());
4431 _assertReplace(node, new Getter_NodeReplacerTest_test_mapLiteralEntry()); 4398 _assertReplace(node, new Getter_NodeReplacerTest_test_mapLiteralEntry());
4432 } 4399 }
4433 4400
4434 void test_methodDeclaration() { 4401 void test_methodDeclaration() {
4435 MethodDeclaration node = AstFactory.methodDeclaration2( 4402 MethodDeclaration node = AstFactory.methodDeclaration2(
4436 null, 4403 null,
4437 AstFactory.typeName4("A", []), 4404 AstFactory.typeName4("A"),
4438 null, 4405 null,
4439 null, 4406 null,
4440 AstFactory.identifier3("m"), 4407 AstFactory.identifier3("m"),
4441 AstFactory.formalParameterList([]), 4408 AstFactory.formalParameterList(),
4442 AstFactory.blockFunctionBody(AstFactory.block([]))); 4409 AstFactory.blockFunctionBody(AstFactory.block()));
4443 node.documentationComment = 4410 node.documentationComment =
4444 Comment.createEndOfLineComment(new List<Token>(0)); 4411 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4445 node.metadata = 4412 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4446 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4447 _assertReplace(node, new Getter_NodeReplacerTest_test_methodDeclaration()); 4413 _assertReplace(node, new Getter_NodeReplacerTest_test_methodDeclaration());
4448 _assertReplace( 4414 _assertReplace(
4449 node, 4415 node,
4450 new Getter_NodeReplacerTest_test_methodDeclaration_3()); 4416 new Getter_NodeReplacerTest_test_methodDeclaration_3());
4451 _assertReplace( 4417 _assertReplace(
4452 node, 4418 node,
4453 new Getter_NodeReplacerTest_test_methodDeclaration_4()); 4419 new Getter_NodeReplacerTest_test_methodDeclaration_4());
4454 _assertReplace( 4420 _assertReplace(
4455 node, 4421 node,
4456 new Getter_NodeReplacerTest_test_methodDeclaration_2()); 4422 new Getter_NodeReplacerTest_test_methodDeclaration_2());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
4488 ParenthesizedExpression node = 4454 ParenthesizedExpression node =
4489 AstFactory.parenthesizedExpression(AstFactory.integer(0)); 4455 AstFactory.parenthesizedExpression(AstFactory.integer(0));
4490 _assertReplace( 4456 _assertReplace(
4491 node, 4457 node,
4492 new Getter_NodeReplacerTest_test_parenthesizedExpression()); 4458 new Getter_NodeReplacerTest_test_parenthesizedExpression());
4493 } 4459 }
4494 4460
4495 void test_partDirective() { 4461 void test_partDirective() {
4496 PartDirective node = AstFactory.partDirective2(""); 4462 PartDirective node = AstFactory.partDirective2("");
4497 node.documentationComment = 4463 node.documentationComment =
4498 Comment.createEndOfLineComment(new List<Token>(0)); 4464 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4499 node.metadata = 4465 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4500 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4501 _testUriBasedDirective(node); 4466 _testUriBasedDirective(node);
4502 } 4467 }
4503 4468
4504 void test_partOfDirective() { 4469 void test_partOfDirective() {
4505 PartOfDirective node = 4470 PartOfDirective node =
4506 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"])); 4471 AstFactory.partOfDirective(AstFactory.libraryIdentifier2(["lib"]));
4507 node.documentationComment = 4472 node.documentationComment =
4508 Comment.createEndOfLineComment(new List<Token>(0)); 4473 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4509 node.metadata = 4474 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4510 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4511 _assertReplace(node, new Getter_NodeReplacerTest_test_partOfDirective()); 4475 _assertReplace(node, new Getter_NodeReplacerTest_test_partOfDirective());
4512 _testAnnotatedNode(node); 4476 _testAnnotatedNode(node);
4513 } 4477 }
4514 4478
4515 void test_postfixExpression() { 4479 void test_postfixExpression() {
4516 PostfixExpression node = AstFactory.postfixExpression( 4480 PostfixExpression node = AstFactory.postfixExpression(
4517 AstFactory.identifier3("x"), 4481 AstFactory.identifier3("x"),
4518 TokenType.MINUS_MINUS); 4482 TokenType.MINUS_MINUS);
4519 _assertReplace(node, new Getter_NodeReplacerTest_test_postfixExpression()); 4483 _assertReplace(node, new Getter_NodeReplacerTest_test_postfixExpression());
4520 } 4484 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
4558 4522
4559 void test_showCombinator() { 4523 void test_showCombinator() {
4560 ShowCombinator node = AstFactory.showCombinator2(["X", "Y"]); 4524 ShowCombinator node = AstFactory.showCombinator2(["X", "Y"]);
4561 _assertReplace( 4525 _assertReplace(
4562 node, 4526 node,
4563 new ListGetter_NodeReplacerTest_test_showCombinator(0)); 4527 new ListGetter_NodeReplacerTest_test_showCombinator(0));
4564 } 4528 }
4565 4529
4566 void test_simpleFormalParameter() { 4530 void test_simpleFormalParameter() {
4567 SimpleFormalParameter node = 4531 SimpleFormalParameter node =
4568 AstFactory.simpleFormalParameter4(AstFactory.typeName4("T", []), "p"); 4532 AstFactory.simpleFormalParameter4(AstFactory.typeName4("T"), "p");
4569 node.documentationComment = 4533 node.documentationComment =
4570 Comment.createEndOfLineComment(new List<Token>(0)); 4534 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4571 node.metadata = 4535 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4572 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4573 _assertReplace( 4536 _assertReplace(
4574 node, 4537 node,
4575 new Getter_NodeReplacerTest_test_simpleFormalParameter()); 4538 new Getter_NodeReplacerTest_test_simpleFormalParameter());
4576 _testNormalFormalParameter(node); 4539 _testNormalFormalParameter(node);
4577 } 4540 }
4578 4541
4579 void test_stringInterpolation() { 4542 void test_stringInterpolation() {
4580 StringInterpolation node = 4543 StringInterpolation node =
4581 AstFactory.string([AstFactory.interpolationExpression2("a")]); 4544 AstFactory.string([AstFactory.interpolationExpression2("a")]);
4582 _assertReplace( 4545 _assertReplace(
4583 node, 4546 node,
4584 new ListGetter_NodeReplacerTest_test_stringInterpolation(0)); 4547 new ListGetter_NodeReplacerTest_test_stringInterpolation(0));
4585 } 4548 }
4586 4549
4587 void test_superConstructorInvocation() { 4550 void test_superConstructorInvocation() {
4588 SuperConstructorInvocation node = 4551 SuperConstructorInvocation node =
4589 AstFactory.superConstructorInvocation2("s", [AstFactory.integer(1)]); 4552 AstFactory.superConstructorInvocation2("s", [AstFactory.integer(1)]);
4590 _assertReplace( 4553 _assertReplace(
4591 node, 4554 node,
4592 new Getter_NodeReplacerTest_test_superConstructorInvocation()); 4555 new Getter_NodeReplacerTest_test_superConstructorInvocation());
4593 _assertReplace( 4556 _assertReplace(
4594 node, 4557 node,
4595 new Getter_NodeReplacerTest_test_superConstructorInvocation_2()); 4558 new Getter_NodeReplacerTest_test_superConstructorInvocation_2());
4596 } 4559 }
4597 4560
4598 void test_switchCase() { 4561 void test_switchCase() {
4599 SwitchCase node = AstFactory.switchCase2( 4562 SwitchCase node = AstFactory.switchCase2(
4600 AstFactory.list([AstFactory.label2("l")]), 4563 [AstFactory.label2("l")],
4601 AstFactory.integer(0), 4564 AstFactory.integer(0),
4602 [AstFactory.block([])]); 4565 [AstFactory.block()]);
4603 _assertReplace(node, new Getter_NodeReplacerTest_test_switchCase()); 4566 _assertReplace(node, new Getter_NodeReplacerTest_test_switchCase());
4604 _testSwitchMember(node); 4567 _testSwitchMember(node);
4605 } 4568 }
4606 4569
4607 void test_switchDefault() { 4570 void test_switchDefault() {
4608 SwitchDefault node = AstFactory.switchDefault( 4571 SwitchDefault node = AstFactory.switchDefault(
4609 AstFactory.list([AstFactory.label2("l")]), 4572 [AstFactory.label2("l")],
4610 [AstFactory.block([])]); 4573 [AstFactory.block()]);
4611 _testSwitchMember(node); 4574 _testSwitchMember(node);
4612 } 4575 }
4613 4576
4614 void test_switchStatement() { 4577 void test_switchStatement() {
4615 SwitchStatement node = AstFactory.switchStatement( 4578 SwitchStatement node = AstFactory.switchStatement(
4616 AstFactory.identifier3("x"), 4579 AstFactory.identifier3("x"),
4617 [ 4580 [
4618 AstFactory.switchCase2( 4581 AstFactory.switchCase2(
4619 AstFactory.list([AstFactory.label2("l")]), 4582 [AstFactory.label2("l")],
4620 AstFactory.integer(0), 4583 AstFactory.integer(0),
4621 [AstFactory.block([])]), 4584 [AstFactory.block()]),
4622 AstFactory.switchDefault( 4585 AstFactory.switchDefault(
4623 AstFactory.list([AstFactory.label2("l")]), 4586 [AstFactory.label2("l")],
4624 [AstFactory.block([])])]); 4587 [AstFactory.block()])]);
4625 _assertReplace(node, new Getter_NodeReplacerTest_test_switchStatement()); 4588 _assertReplace(node, new Getter_NodeReplacerTest_test_switchStatement());
4626 _assertReplace( 4589 _assertReplace(
4627 node, 4590 node,
4628 new ListGetter_NodeReplacerTest_test_switchStatement(0)); 4591 new ListGetter_NodeReplacerTest_test_switchStatement(0));
4629 } 4592 }
4630 4593
4631 void test_throwExpression() { 4594 void test_throwExpression() {
4632 ThrowExpression node = 4595 ThrowExpression node =
4633 AstFactory.throwExpression2(AstFactory.identifier3("e")); 4596 AstFactory.throwExpression2(AstFactory.identifier3("e"));
4634 _assertReplace(node, new Getter_NodeReplacerTest_test_throwExpression()); 4597 _assertReplace(node, new Getter_NodeReplacerTest_test_throwExpression());
4635 } 4598 }
4636 4599
4637 void test_topLevelVariableDeclaration() { 4600 void test_topLevelVariableDeclaration() {
4638 TopLevelVariableDeclaration node = AstFactory.topLevelVariableDeclaration( 4601 TopLevelVariableDeclaration node = AstFactory.topLevelVariableDeclaration(
4639 null, 4602 null,
4640 AstFactory.typeName4("T", []), 4603 AstFactory.typeName4("T"),
4641 [AstFactory.variableDeclaration("t")]); 4604 [AstFactory.variableDeclaration("t")]);
4642 node.documentationComment = 4605 node.documentationComment =
4643 Comment.createEndOfLineComment(new List<Token>(0)); 4606 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4644 node.metadata = 4607 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4645 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4646 _assertReplace( 4608 _assertReplace(
4647 node, 4609 node,
4648 new Getter_NodeReplacerTest_test_topLevelVariableDeclaration()); 4610 new Getter_NodeReplacerTest_test_topLevelVariableDeclaration());
4649 _testAnnotatedNode(node); 4611 _testAnnotatedNode(node);
4650 } 4612 }
4651 4613
4652 void test_tryStatement() { 4614 void test_tryStatement() {
4653 TryStatement node = AstFactory.tryStatement3( 4615 TryStatement node = AstFactory.tryStatement3(
4654 AstFactory.block([]), 4616 AstFactory.block(),
4655 AstFactory.list([AstFactory.catchClause("e", [AstFactory.block([])])]), 4617 [AstFactory.catchClause("e", [AstFactory.block()])],
4656 AstFactory.block([])); 4618 AstFactory.block());
4657 _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement_2()); 4619 _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement_2());
4658 _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement()); 4620 _assertReplace(node, new Getter_NodeReplacerTest_test_tryStatement());
4659 _assertReplace(node, new ListGetter_NodeReplacerTest_test_tryStatement(0)); 4621 _assertReplace(node, new ListGetter_NodeReplacerTest_test_tryStatement(0));
4660 } 4622 }
4661 4623
4662 void test_typeArgumentList() { 4624 void test_typeArgumentList() {
4663 TypeArgumentList node = 4625 TypeArgumentList node =
4664 AstFactory.typeArgumentList([AstFactory.typeName4("A", [])]); 4626 AstFactory.typeArgumentList([AstFactory.typeName4("A")]);
4665 _assertReplace( 4627 _assertReplace(
4666 node, 4628 node,
4667 new ListGetter_NodeReplacerTest_test_typeArgumentList(0)); 4629 new ListGetter_NodeReplacerTest_test_typeArgumentList(0));
4668 } 4630 }
4669 4631
4670 void test_typeName() { 4632 void test_typeName() {
4671 TypeName node = AstFactory.typeName4( 4633 TypeName node = AstFactory.typeName4(
4672 "T", 4634 "T",
4673 [AstFactory.typeName4("E", []), AstFactory.typeName4("F", [])]); 4635 [AstFactory.typeName4("E"), AstFactory.typeName4("F")]);
4674 _assertReplace(node, new Getter_NodeReplacerTest_test_typeName_2()); 4636 _assertReplace(node, new Getter_NodeReplacerTest_test_typeName_2());
4675 _assertReplace(node, new Getter_NodeReplacerTest_test_typeName()); 4637 _assertReplace(node, new Getter_NodeReplacerTest_test_typeName());
4676 } 4638 }
4677 4639
4678 void test_typeParameter() { 4640 void test_typeParameter() {
4679 TypeParameter node = 4641 TypeParameter node =
4680 AstFactory.typeParameter2("E", AstFactory.typeName4("B", [])); 4642 AstFactory.typeParameter2("E", AstFactory.typeName4("B"));
4681 _assertReplace(node, new Getter_NodeReplacerTest_test_typeParameter_2()); 4643 _assertReplace(node, new Getter_NodeReplacerTest_test_typeParameter_2());
4682 _assertReplace(node, new Getter_NodeReplacerTest_test_typeParameter()); 4644 _assertReplace(node, new Getter_NodeReplacerTest_test_typeParameter());
4683 } 4645 }
4684 4646
4685 void test_typeParameterList() { 4647 void test_typeParameterList() {
4686 TypeParameterList node = AstFactory.typeParameterList(["A", "B"]); 4648 TypeParameterList node = AstFactory.typeParameterList(["A", "B"]);
4687 _assertReplace( 4649 _assertReplace(
4688 node, 4650 node,
4689 new ListGetter_NodeReplacerTest_test_typeParameterList(0)); 4651 new ListGetter_NodeReplacerTest_test_typeParameterList(0));
4690 } 4652 }
4691 4653
4692 void test_variableDeclaration() { 4654 void test_variableDeclaration() {
4693 VariableDeclaration node = 4655 VariableDeclaration node =
4694 AstFactory.variableDeclaration2("a", AstFactory.nullLiteral()); 4656 AstFactory.variableDeclaration2("a", AstFactory.nullLiteral());
4695 node.documentationComment = 4657 node.documentationComment =
4696 Comment.createEndOfLineComment(new List<Token>(0)); 4658 Comment.createEndOfLineComment(EMPTY_TOKEN_LIST);
4697 node.metadata = 4659 node.metadata = [AstFactory.annotation(AstFactory.identifier3("a"))];
4698 AstFactory.list([AstFactory.annotation(AstFactory.identifier3("a"))]);
4699 _assertReplace( 4660 _assertReplace(
4700 node, 4661 node,
4701 new Getter_NodeReplacerTest_test_variableDeclaration()); 4662 new Getter_NodeReplacerTest_test_variableDeclaration());
4702 _assertReplace( 4663 _assertReplace(
4703 node, 4664 node,
4704 new Getter_NodeReplacerTest_test_variableDeclaration_2()); 4665 new Getter_NodeReplacerTest_test_variableDeclaration_2());
4705 _testAnnotatedNode(node); 4666 _testAnnotatedNode(node);
4706 } 4667 }
4707 4668
4708 void test_variableDeclarationList() { 4669 void test_variableDeclarationList() {
4709 VariableDeclarationList node = AstFactory.variableDeclarationList( 4670 VariableDeclarationList node = AstFactory.variableDeclarationList(
4710 null, 4671 null,
4711 AstFactory.typeName4("T", []), 4672 AstFactory.typeName4("T"),
4712 [AstFactory.variableDeclaration("a")]); 4673 [AstFactory.variableDeclaration("a")]);
4713 _assertReplace( 4674 _assertReplace(
4714 node, 4675 node,
4715 new Getter_NodeReplacerTest_test_variableDeclarationList()); 4676 new Getter_NodeReplacerTest_test_variableDeclarationList());
4716 _assertReplace( 4677 _assertReplace(
4717 node, 4678 node,
4718 new ListGetter_NodeReplacerTest_test_variableDeclarationList(0)); 4679 new ListGetter_NodeReplacerTest_test_variableDeclarationList(0));
4719 } 4680 }
4720 4681
4721 void test_variableDeclarationStatement() { 4682 void test_variableDeclarationStatement() {
4722 VariableDeclarationStatement node = AstFactory.variableDeclarationStatement( 4683 VariableDeclarationStatement node = AstFactory.variableDeclarationStatement(
4723 null, 4684 null,
4724 AstFactory.typeName4("T", []), 4685 AstFactory.typeName4("T"),
4725 [AstFactory.variableDeclaration("a")]); 4686 [AstFactory.variableDeclaration("a")]);
4726 _assertReplace( 4687 _assertReplace(
4727 node, 4688 node,
4728 new Getter_NodeReplacerTest_test_variableDeclarationStatement()); 4689 new Getter_NodeReplacerTest_test_variableDeclarationStatement());
4729 } 4690 }
4730 4691
4731 void test_whileStatement() { 4692 void test_whileStatement() {
4732 WhileStatement node = AstFactory.whileStatement( 4693 WhileStatement node = AstFactory.whileStatement(
4733 AstFactory.booleanLiteral(true), 4694 AstFactory.booleanLiteral(true),
4734 AstFactory.block([])); 4695 AstFactory.block());
4735 _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement()); 4696 _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement());
4736 _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement_2()); 4697 _assertReplace(node, new Getter_NodeReplacerTest_test_whileStatement_2());
4737 } 4698 }
4738 4699
4739 void test_withClause() { 4700 void test_withClause() {
4740 WithClause node = AstFactory.withClause([AstFactory.typeName4("M", [])]); 4701 WithClause node = AstFactory.withClause([AstFactory.typeName4("M")]);
4741 _assertReplace(node, new ListGetter_NodeReplacerTest_test_withClause(0)); 4702 _assertReplace(node, new ListGetter_NodeReplacerTest_test_withClause(0));
4742 } 4703 }
4743 4704
4744 void _assertReplace(AstNode parent, NodeReplacerTest_Getter getter) { 4705 void _assertReplace(AstNode parent, NodeReplacerTest_Getter getter) {
4745 AstNode child = getter.get(parent); 4706 AstNode child = getter.get(parent);
4746 if (child != null) { 4707 if (child != null) {
4747 AstNode clone = child.accept(new AstCloner()); 4708 AstNode clone = child.accept(new AstCloner());
4748 NodeReplacer.replace(child, clone); 4709 NodeReplacer.replace(child, clone);
4749 expect(getter.get(parent), clone); 4710 expect(getter.get(parent), clone);
4750 expect(clone.parent, parent); 4711 expect(clone.parent, parent);
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
5249 } 5210 }
5250 5211
5251 void test_get_added() { 5212 void test_get_added() {
5252 TokenMap tokenMap = new TokenMap(); 5213 TokenMap tokenMap = new TokenMap();
5253 Token key = TokenFactory.tokenFromType(TokenType.AT); 5214 Token key = TokenFactory.tokenFromType(TokenType.AT);
5254 Token value = TokenFactory.tokenFromType(TokenType.AT); 5215 Token value = TokenFactory.tokenFromType(TokenType.AT);
5255 tokenMap.put(key, value); 5216 tokenMap.put(key, value);
5256 expect(tokenMap.get(key), same(value)); 5217 expect(tokenMap.get(key), same(value));
5257 } 5218 }
5258 } 5219 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/test_support.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698