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

Unified Diff: tests/compiler/dart2js/instantiated_classes_test.dart

Issue 1168393003: Enforce LF line endings in the git database. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebase Created 5 years, 6 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
Index: tests/compiler/dart2js/instantiated_classes_test.dart
diff --git a/tests/compiler/dart2js/instantiated_classes_test.dart b/tests/compiler/dart2js/instantiated_classes_test.dart
index d125ff99f27026b4ec1a5398495f85dfb7a5f983..ea90156607c30ad939248ce36c3344048626e446 100644
--- a/tests/compiler/dart2js/instantiated_classes_test.dart
+++ b/tests/compiler/dart2js/instantiated_classes_test.dart
@@ -1,85 +1,85 @@
-// Copyright (c) 2014, 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 instantiated_classes_test;
-
-import 'dart:async';
-import 'package:expect/expect.dart';
-import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/elements/elements.dart'
- show ClassElement;
-import 'type_test_helper.dart';
-
-void main() {
- asyncTest(() => Future.forEach([
- () => test("class Class {}", ["Class"]),
- () => test("""abstract class A {}
- class Class extends A {}""",
- ["Class"]),
- () => test("""class A {}
- class Class extends A {}""",
- ["Class"]),
- () => test("""class A {}
- class B {}
- class Class extends A {}""",
- ["Class"]),
- () => test("""class A {}
- class Class implements A {}""",
- ["Class"]),
- () => test("""class A {}
- class Class extends Object with A {}""",
- ["Class"]),
- () => test("""class A {}
- class B {}
- class Class extends Object with B implements A {}""",
- ["Class"]),
-
- () => test("""class A {}
- class Class {}""",
- ["Class", "A"], ["Class", "A"]),
- () => test("""class A {}
- class Class extends A {}""",
- ["Class", "A"], ["Class", "A"]),
- () => test("""class A {}
- class Class implements A {}""",
- ["Class", "A"], ["Class", "A"]),
- () => test("""class A {}
- class B extends A {}
- class Class extends B {}""",
- ["Class", "A"], ["Class", "A"]),
- () => test("""class A {}
- class B {}
- class Class extends B with A {}""",
- ["Class", "A"], ["Class", "A"]),
-
- // TODO(johnniwinther): Avoid registration of `Class` as instantiated.
- () => test("""class A {}
- class Class implements A {
- factory Class() = A;
- }""",
- ["Class", "A"], ["Class"]),
- ], (f) => f()));
-}
-
-Future test(String source, List<String> directlyInstantiatedClasses,
- [List<String> newClasses = const <String>["Class"]]) {
- StringBuffer mainSource = new StringBuffer();
- mainSource.write('main() {\n');
- for (String newClass in newClasses) {
- mainSource.write(' new $newClass();\n');
- }
- mainSource.write('}');
- return TypeEnvironment.create(source,
- mainSource: mainSource.toString(),
- useMockCompiler: true).then((env) {
- Iterable<ClassElement> expectedClasses =
- directlyInstantiatedClasses.map(env.getElement);
- Iterable<ClassElement> actualClasses =
- env.compiler.resolverWorld.directlyInstantiatedClasses.where(
- (c) => c.library == env.compiler.mainApp);
- Expect.setEquals(expectedClasses, actualClasses);
- });
-}
-
-
+// Copyright (c) 2014, 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 instantiated_classes_test;
+
+import 'dart:async';
+import 'package:expect/expect.dart';
+import 'package:async_helper/async_helper.dart';
+import 'package:compiler/src/elements/elements.dart'
+ show ClassElement;
+import 'type_test_helper.dart';
+
+void main() {
+ asyncTest(() => Future.forEach([
+ () => test("class Class {}", ["Class"]),
+ () => test("""abstract class A {}
+ class Class extends A {}""",
+ ["Class"]),
+ () => test("""class A {}
+ class Class extends A {}""",
+ ["Class"]),
+ () => test("""class A {}
+ class B {}
+ class Class extends A {}""",
+ ["Class"]),
+ () => test("""class A {}
+ class Class implements A {}""",
+ ["Class"]),
+ () => test("""class A {}
+ class Class extends Object with A {}""",
+ ["Class"]),
+ () => test("""class A {}
+ class B {}
+ class Class extends Object with B implements A {}""",
+ ["Class"]),
+
+ () => test("""class A {}
+ class Class {}""",
+ ["Class", "A"], ["Class", "A"]),
+ () => test("""class A {}
+ class Class extends A {}""",
+ ["Class", "A"], ["Class", "A"]),
+ () => test("""class A {}
+ class Class implements A {}""",
+ ["Class", "A"], ["Class", "A"]),
+ () => test("""class A {}
+ class B extends A {}
+ class Class extends B {}""",
+ ["Class", "A"], ["Class", "A"]),
+ () => test("""class A {}
+ class B {}
+ class Class extends B with A {}""",
+ ["Class", "A"], ["Class", "A"]),
+
+ // TODO(johnniwinther): Avoid registration of `Class` as instantiated.
+ () => test("""class A {}
+ class Class implements A {
+ factory Class() = A;
+ }""",
+ ["Class", "A"], ["Class"]),
+ ], (f) => f()));
+}
+
+Future test(String source, List<String> directlyInstantiatedClasses,
+ [List<String> newClasses = const <String>["Class"]]) {
+ StringBuffer mainSource = new StringBuffer();
+ mainSource.write('main() {\n');
+ for (String newClass in newClasses) {
+ mainSource.write(' new $newClass();\n');
+ }
+ mainSource.write('}');
+ return TypeEnvironment.create(source,
+ mainSource: mainSource.toString(),
+ useMockCompiler: true).then((env) {
+ Iterable<ClassElement> expectedClasses =
+ directlyInstantiatedClasses.map(env.getElement);
+ Iterable<ClassElement> actualClasses =
+ env.compiler.resolverWorld.directlyInstantiatedClasses.where(
+ (c) => c.library == env.compiler.mainApp);
+ Expect.setEquals(expectedClasses, actualClasses);
+ });
+}
+
+
« no previous file with comments | « tests/compiler/dart2js/import_mirrors_test.dart ('k') | tests/compiler/dart2js/least_upper_bound_language_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698