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

Side by Side Diff: pkg/analyzer/test/src/dart/analysis/defined_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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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/defined_names.dart'; 6 import 'package:analyzer/src/dart/analysis/defined_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(DefinedNamesTest); 14 defineReflectiveTests(DefinedNamesTest);
15 }); 15 });
16 } 16 }
17 17
18 @reflectiveTest 18 @reflectiveTest
19 class DefinedNamesTest { 19 class DefinedNamesTest extends ParserTestCase {
20 test_classMemberNames() { 20 test_classMemberNames() {
21 DefinedNames names = _computeDefinedNames(''' 21 DefinedNames names = _computeDefinedNames('''
22 class A { 22 class A {
23 int a, b; 23 int a, b;
24 A(); 24 A();
25 A.c(); 25 A.c();
26 d() {} 26 d() {}
27 get e => null; 27 get e => null;
28 set f(_) {} 28 set f(_) {}
29 } 29 }
(...skipping 15 matching lines...) Expand all
45 get E => null; 45 get E => null;
46 set F(_) {} 46 set F(_) {}
47 var G, H; 47 var G, H;
48 '''); 48 ''');
49 expect(names.topLevelNames, 49 expect(names.topLevelNames,
50 unorderedEquals(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'])); 50 unorderedEquals(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']));
51 expect(names.classMemberNames, isEmpty); 51 expect(names.classMemberNames, isEmpty);
52 } 52 }
53 53
54 DefinedNames _computeDefinedNames(String code) { 54 DefinedNames _computeDefinedNames(String code) {
55 CompilationUnit unit = ParserTestCase.parseCompilationUnit2(code); 55 CompilationUnit unit = parseCompilationUnit2(code);
56 return computeDefinedNames(unit); 56 return computeDefinedNames(unit);
57 } 57 }
58 } 58 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/resolver_test.dart ('k') | pkg/analyzer/test/src/dart/analysis/referenced_names_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698