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

Unified Diff: pkg/analyzer/test/src/task/strong_mode_test.dart

Issue 1294023006: TBR Add missed test file (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong_mode_test.dart
diff --git a/pkg/analyzer/test/src/task/strong_mode_test.dart b/pkg/analyzer/test/src/task/strong_mode_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8b66fe7cf8366d9ccfab51c334cf64d3dc466e89
--- /dev/null
+++ b/pkg/analyzer/test/src/task/strong_mode_test.dart
@@ -0,0 +1,59 @@
+// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library test.src.task.strong_mode_test;
+
+import 'package:analyzer/src/generated/ast.dart';
+import 'package:analyzer/src/generated/source.dart';
+import 'package:analyzer/src/task/strong_mode.dart';
+import 'package:analyzer/task/dart.dart';
+import 'package:unittest/unittest.dart';
+
+import '../../reflective_tests.dart';
+import '../../utils.dart';
+import '../context/abstract_context.dart';
+
+main() {
+ initializeTestEnvironment();
+ runReflectiveTests(InferrenceFinderTest);
+}
+
+@reflectiveTest
+class InferrenceFinderTest extends AbstractContextTest {
+ void test_creation() {
+ InferrenceFinder finder = new InferrenceFinder();
+ expect(finder, isNotNull);
+ expect(finder.classes, isEmpty);
+ expect(finder.staticVariables, isEmpty);
+ }
+
+ void test_visit() {
+ Source source = addSource(
+ '/test.dart',
+ r'''
+const c = 1;
+final f = '';
+var v = const A();
+class A {
+ static final fa = 0;
+ const A();
+}
+class B extends A {
+ static const cb = 1;
+ static vb = 0;
+ const ci = 2;
+ final fi = '';
+ var vi;
+}
+class C = Object with A;
+typedef int F(int x);
+''');
+ computeResult(source, PARSED_UNIT);
+ CompilationUnit unit = outputs[PARSED_UNIT];
+ InferrenceFinder finder = new InferrenceFinder();
+ unit.accept(finder);
+ expect(finder.classes, hasLength(3));
+ expect(finder.staticVariables, hasLength(6));
+ }
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698