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

Unified Diff: pkg/unittest/test/matchers_test.dart

Issue 12221157: Our nice new mismatched type error messages are garbled by minification. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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 | « no previous file | pkg/unittest/test/test_utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/test/matchers_test.dart
===================================================================
--- pkg/unittest/test/matchers_test.dart (revision 18401)
+++ pkg/unittest/test/matchers_test.dart (working copy)
@@ -249,10 +249,17 @@
test('type mismatch', () {
var a = new DateTime.utc(2000);
var b = a.toString();
+ // We should get something like:
+ // Expected: '2000-01-01 00:00:00.000Z'
+ // but: expected String:'2000-01-01 00:00:00.000Z'
+ // but was DateTime:<2000-01-01 00:00:00.000Z>.
+ // However, if minification is applied, then the type names
+ // will be shortened to two letters. The key thing is that
+ // there will be a "but: expected" part in the middle;
+ // this only happens with type mismatches or mismatches
+ // inside container types.
shouldFail(a, equals(b),
- "Expected: '2000-01-01 00:00:00.000Z' "
- "but: expected String:'2000-01-01 00:00:00.000Z' "
- "but was DateTime:<2000-01-01 00:00:00.000Z>.");
+ matches(new RegExp("^Expected.*but: expected .*but was.*\$")));
});
});
« no previous file with comments | « no previous file | pkg/unittest/test/test_utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698