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

Unified Diff: pkg/polymer/test/transform/common.dart

Issue 23772007: ignore trailing whitespace in polymer transform test (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « pkg/polymer/test/transform/all_phases_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/polymer/test/transform/common.dart
diff --git a/pkg/polymer/test/transform/common.dart b/pkg/polymer/test/transform/common.dart
index f1d85000ab052c0f4d795ab71162d85bac4dfdaa..db9032bf85b9bc07610ae73111c2b8ecc09984d3 100644
--- a/pkg/polymer/test/transform/common.dart
+++ b/pkg/polymer/test/transform/common.dart
@@ -16,6 +16,10 @@ AssetId idFromString(String s) {
return new AssetId(s.substring(0, index), s.substring(index + 1));
}
+String _removeTrailingWhitespace(String str) =>
+ str.splitMapJoin('\n',
+ onNonMatch: (s) => s.replaceAll(new RegExp(r'\s+$'), ''));
Jennifer Messerly 2013/09/06 01:36:08 Dart doesn't have a trimEnd, as far as I can tell.
+
/**
* A helper package provider that has files stored in memory, also wraps
* [Barback] to simply our tests.
@@ -74,6 +78,8 @@ class TestHelper implements PackageProvider {
Future check(String assetIdString, String content) {
return this[assetIdString].then((value) {
+ value = _removeTrailingWhitespace(value);
+ content = _removeTrailingWhitespace(content);
expect(value, content, reason: 'Final output of $assetIdString differs.');
});
}
« no previous file with comments | « pkg/polymer/test/transform/all_phases_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698