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

Unified Diff: compiler/javatests/com/google/dart/compiler/PrettyErrorFormatterTest.java

Issue 9034022: Include compiler tests suite, tweaks for tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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: compiler/javatests/com/google/dart/compiler/PrettyErrorFormatterTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/PrettyErrorFormatterTest.java b/compiler/javatests/com/google/dart/compiler/PrettyErrorFormatterTest.java
index b4a5967c70893ceabbb2b393a74263777c76cca1..480cfb16b898c9f75f29b7ac2c9f19a1dbc2981d 100644
--- a/compiler/javatests/com/google/dart/compiler/PrettyErrorFormatterTest.java
+++ b/compiler/javatests/com/google/dart/compiler/PrettyErrorFormatterTest.java
@@ -70,7 +70,9 @@ public class PrettyErrorFormatterTest extends TestCase {
new DartCompilationError(badDartSource, location, TypeErrorCode.NO_SUCH_TYPE, "Foo");
//
String errorString = getErrorString(error, false, false);
- assertEquals("my/path/Test.dart:1:3: no such type \"Foo\"\n", errorString);
+ assertEquals(
+ "my/path/Test.dart:1:3: no such type \"Foo\" (sourced from Test_app)\n",
+ errorString);
}
/**
@@ -83,7 +85,9 @@ public class PrettyErrorFormatterTest extends TestCase {
new DartCompilationError(emptyDartSource, location, TypeErrorCode.NO_SUCH_TYPE, "Foo");
//
String errorString = getErrorString(error, false, false);
- assertEquals("my/path/Test.dart:1:3: no such type \"Foo\"\n", errorString);
+ assertEquals(
+ "my/path/Test.dart:1:3: no such type \"Foo\" (sourced from Test_app)\n",
+ errorString);
}
/**
@@ -97,7 +101,7 @@ public class PrettyErrorFormatterTest extends TestCase {
String errorString = getErrorString(error, false, false);
assertEquals(
Joiner.on("\n").join(
- "my/path/Test.dart:1: no such type \"Foo\"",
+ "my/path/Test.dart:1: no such type \"Foo\" (sourced from Test_app)",
" 1: lineAAA",
" ~~~",
""),
@@ -115,7 +119,7 @@ public class PrettyErrorFormatterTest extends TestCase {
String errorString = getErrorString(error, false, false);
assertEquals(
Joiner.on("\n").join(
- "my/path/Test.dart:2: no such type \"Foo\"",
+ "my/path/Test.dart:2: no such type \"Foo\" (sourced from Test_app)",
" 1: lineAAA",
" 2: lineBBB",
" ~~~~~",
@@ -134,7 +138,9 @@ public class PrettyErrorFormatterTest extends TestCase {
String errorString = getErrorString(error, true, false);
assertEquals(
Joiner.on("\n").join(
- RED_BOLD_COLOR + "my/path/Test.dart:2: no such type \"Foo\"" + NO_COLOR,
+ RED_BOLD_COLOR
+ + "my/path/Test.dart:2: no such type \"Foo\" (sourced from Test_app)"
+ + NO_COLOR,
" 1: lineAAA",
" 2: li" + RED_COLOR + "neBBB" + NO_COLOR,
""),
@@ -152,7 +158,7 @@ public class PrettyErrorFormatterTest extends TestCase {
String errorString = getErrorString(error, false, false);
assertEquals(
Joiner.on("\n").join(
- "my/path/Test.dart:2: no such type \"Foo\"",
+ "my/path/Test.dart:2: no such type \"Foo\" (sourced from Test_app)",
" 1: lineAAA",
" 2: lineBBB",
" ~~~",
@@ -171,7 +177,9 @@ public class PrettyErrorFormatterTest extends TestCase {
String errorString = getErrorString(error, true, false);
assertEquals(
Joiner.on("\n").join(
- RED_BOLD_COLOR + "my/path/Test.dart:2: no such type \"Foo\"" + NO_COLOR,
+ RED_BOLD_COLOR
+ + "my/path/Test.dart:2: no such type \"Foo\" (sourced from Test_app)"
+ + NO_COLOR,
" 1: lineAAA",
" 2: li" + RED_COLOR + "neB" + NO_COLOR + "BB",
""),
@@ -225,8 +233,10 @@ public class PrettyErrorFormatterTest extends TestCase {
boolean printMachineProblems) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
PrintStream printStream = new PrintStream(outputStream);
- ErrorFormatter errorFormatter = new PrettyErrorFormatter(printStream, useColor,
- printMachineProblems ? ErrorFormat.MACHINE : ErrorFormat.NORMAL);
+ ErrorFormatter errorFormatter =
+ new PrettyErrorFormatter(printStream, useColor, printMachineProblems
+ ? ErrorFormat.MACHINE
+ : ErrorFormat.NORMAL);
errorFormatter.format(error);
return outputStream.toString();
}

Powered by Google App Engine
This is Rietveld 408576698