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

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

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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 | « tests/compiler/dart2js/message_kind_test.dart ('k') | tests/compiler/dart2js/metadata_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/message_span_test.dart
diff --git a/tests/compiler/dart2js/message_span_test.dart b/tests/compiler/dart2js/message_span_test.dart
index 655b814cfc26d5ec0fb052eb4a0ac13eed7ab228..57dbddb109696580c2d2ab788fb28795948e4b48 100644
--- a/tests/compiler/dart2js/message_span_test.dart
+++ b/tests/compiler/dart2js/message_span_test.dart
@@ -11,7 +11,8 @@ import 'memory_compiler.dart';
import 'memory_source_file_helper.dart';
const List<Test> TESTS = const <Test>[
- const Test('''
+ const Test(
+ '''
class A { A(b); }
class B extends A {
a() {}
@@ -23,12 +24,13 @@ class B extends A {
var members;
}
main() => new B();''',
- const {
- MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
+ const {
+ MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
class B extends A {
-^^^^^^^^^^^^^^^^^'''}),
-
- const Test('''
+^^^^^^^^^^^^^^^^^'''
+ }),
+ const Test(
+ '''
class I {}
class A { A(b); }
class B extends A implements I {
@@ -41,12 +43,13 @@ class B extends A implements I {
var members;
}
main() => new B();''',
- const {
- MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
+ const {
+ MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
class B extends A implements I {
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'''}),
-
- const Test('''
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'''
+ }),
+ const Test(
+ '''
class M<T> {}
class A { A(b); }
class B extends A with M<int> {
@@ -59,12 +62,13 @@ class B extends A with M<int> {
var members;
}
main() => new B();''',
- const {
- MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
+ const {
+ MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
class B extends A with M<int> {
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'''}),
-
- const Test('''
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'''
+ }),
+ const Test(
+ '''
class A { A(b); }
class B
extends A {
@@ -77,25 +81,27 @@ class B
var members;
}
main() => new B();''',
- const {
- MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
+ const {
+ MessageKind.NO_MATCHING_CONSTRUCTOR_FOR_IMPLICIT: '''
class B
extends A {
-'''}),
-
- const Test('''
+'''
+ }),
+ const Test(
+ '''
void foo(int a) {
// a
// non-empty
// body
}
main() => foo('');''',
- const {
- MessageKind.THIS_IS_THE_METHOD: '''
+ const {
+ MessageKind.THIS_IS_THE_METHOD: '''
void foo(int a) {
-^^^^^^^^^^^^^^^'''}),
-
- const Test('''
+^^^^^^^^^^^^^^^'''
+ }),
+ const Test(
+ '''
void foo(int a,
int b) {
// a
@@ -103,13 +109,14 @@ void foo(int a,
// body
}
main() => foo('', 0);''',
- const {
- MessageKind.THIS_IS_THE_METHOD: '''
+ const {
+ MessageKind.THIS_IS_THE_METHOD: '''
void foo(int a,
int b) {
-'''}),
-
- const Test('''
+'''
+ }),
+ const Test(
+ '''
class A {
int foo() {
// a
@@ -126,13 +133,14 @@ class B extends A {
}
}
main() => new B();''',
- const {
- MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER: '''
+ const {
+ MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER: '''
int get foo {
^^^^^^^^^^^''',
- MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT: '''
+ MessageKind.CANNOT_OVERRIDE_METHOD_WITH_GETTER_CONT: '''
int foo() {
- ^^^^^^^^^'''}),
+ ^^^^^^^^^'''
+ }),
];
class Test {
@@ -165,9 +173,11 @@ main() {
String locationMessage =
sourceFile.getLocationMessage(MARKER, message.begin, message.end);
// Remove `filename:line:column:` and message.
- String strippedLocationMessage = locationMessage.substring(
- locationMessage.indexOf(MARKER) + MARKER.length + 1);
- Expect.equals(expectedSpanText, strippedLocationMessage,
+ String strippedLocationMessage = locationMessage
+ .substring(locationMessage.indexOf(MARKER) + MARKER.length + 1);
+ Expect.equals(
+ expectedSpanText,
+ strippedLocationMessage,
"Unexpected span for ${message.messageKind} in\n${test.code}"
"\nExpected:${expectedSpanText.codeUnits}"
"\nActual :${strippedLocationMessage.codeUnits}");
@@ -179,4 +189,4 @@ main() {
});
}
});
-}
+}
« no previous file with comments | « tests/compiler/dart2js/message_kind_test.dart ('k') | tests/compiler/dart2js/metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698