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

Unified Diff: packages/dart_style/test/formatter_test.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 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
« no previous file with comments | « packages/dart_style/test/command_line_test.dart ('k') | packages/dart_style/test/io_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/dart_style/test/formatter_test.dart
diff --git a/packages/dart_style/test/formatter_test.dart b/packages/dart_style/test/formatter_test.dart
index d2271331b81f1bd7adc759b8986778d5a319da97..b50271f0683d70707950008a2acee6f16392aa8f 100644
--- a/packages/dart_style/test/formatter_test.dart
+++ b/packages/dart_style/test/formatter_test.dart
@@ -149,7 +149,8 @@ void testDirectory(String name) {
}
group("$name ${p.basename(entry.path)}", () {
- var lines = (entry as File).readAsLinesSync();
+ // Explicitly create a File, in case the entry is a Link.
+ var lines = new File(entry.path).readAsLinesSync();
// The first line may have a "|" to indicate the page width.
var pageWidth;
@@ -207,7 +208,13 @@ void testDirectory(String name) {
var actualText = actual.text;
if (!isCompilationUnit) actualText += "\n";
- expect(actualText, equals(expected.text));
+ // Fail with an explicit message because it's easier to read than
+ // the matcher output.
+ if (actualText != expected.text) {
+ fail("Formatting did not match expectation. Expected:\n"
+ "${expected.text}\nActual:\n$actualText");
+ }
+
expect(actual.selectionStart, equals(expected.selectionStart));
expect(actual.selectionLength, equals(expected.selectionLength));
});
« no previous file with comments | « packages/dart_style/test/command_line_test.dart ('k') | packages/dart_style/test/io_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698