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

Side by Side Diff: pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart

Issue 2683543006: Make some parser test helper methods non-static. (Closed)
Patch Set: Created 3 years, 10 months 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 import 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/src/dart/analysis/referenced_names.dart'; 6 import 'package:analyzer/src/dart/analysis/referenced_names.dart';
7 import 'package:test/test.dart'; 7 import 'package:test/test.dart';
8 import 'package:test_reflective_loader/test_reflective_loader.dart'; 8 import 'package:test_reflective_loader/test_reflective_loader.dart';
9 9
10 import '../../../generated/parser_test.dart'; 10 import '../../../generated/parser_test.dart';
11 11
12 main() { 12 main() {
13 defineReflectiveSuite(() { 13 defineReflectiveSuite(() {
14 defineReflectiveTests(ReferencedNamesBuilderTest); 14 defineReflectiveTests(ReferencedNamesBuilderTest);
15 }); 15 });
16 } 16 }
17 17
18 @reflectiveTest 18 @reflectiveTest
19 class ReferencedNamesBuilderTest { 19 class ReferencedNamesBuilderTest extends ParserTestCase {
20 test_class_constructor() { 20 test_class_constructor() {
21 Set<String> names = _computeReferencedNames(''' 21 Set<String> names = _computeReferencedNames('''
22 class U { 22 class U {
23 U.named(A a, B b) { 23 U.named(A a, B b) {
24 C c = null; 24 C c = null;
25 } 25 }
26 } 26 }
27 '''); 27 ''');
28 expect(names, unorderedEquals(['A', 'B', 'C'])); 28 expect(names, unorderedEquals(['A', 'B', 'C']));
29 } 29 }
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 L5; 376 L5;
377 L6; 377 L6;
378 L7; 378 L7;
379 L8; 379 L8;
380 } 380 }
381 '''); 381 ''');
382 expect(names, unorderedEquals(['A', 'B', 'C'])); 382 expect(names, unorderedEquals(['A', 'B', 'C']));
383 } 383 }
384 384
385 Set<String> _computeReferencedNames(String code) { 385 Set<String> _computeReferencedNames(String code) {
386 CompilationUnit unit = ParserTestCase.parseCompilationUnit2(code); 386 CompilationUnit unit = parseCompilationUnit2(code);
387 return computeReferencedNames(unit); 387 return computeReferencedNames(unit);
388 } 388 }
389 } 389 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/dart/analysis/defined_names_test.dart ('k') | pkg/analyzer/test/src/dart/ast/utilities_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698