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

Unified Diff: pkg/intl/test/date_time_format_test_core.dart

Issue 102443007: Add lots of debugging machinery for flaky datetime creation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Changes from review comments Created 7 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 | « pkg/intl/lib/src/temporary_debugging.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/intl/test/date_time_format_test_core.dart
diff --git a/pkg/intl/test/date_time_format_test_core.dart b/pkg/intl/test/date_time_format_test_core.dart
index 65461e2e069bb8a125d61804ee60508591fe6e51..989b264f84095ee649762cd36c21f3f2155795d1 100644
--- a/pkg/intl/test/date_time_format_test_core.dart
+++ b/pkg/intl/test/date_time_format_test_core.dart
@@ -14,6 +14,7 @@ import 'package:unittest/unittest.dart';
import 'date_time_format_test_data.dart';
import 'package:intl/intl.dart';
import 'package:intl/src/date_format_internal.dart';
+import 'package:intl/src/temporary_debugging.dart';
var formatsToTest = const [
DateFormat.DAY,
@@ -164,6 +165,7 @@ testRoundTripParsing(String localeName, DateTime date) {
if (!badSkeletons.any((x) => x == skeleton)) {
var format = new DateFormat(skeleton, localeName);
var actualResult = format.format(date);
+ debugLogDateCreation = true;
var parsed = format.parse(actualResult);
var thenPrintAgain = format.format(parsed);
// We've seen a case where this failed in a way that seemed like a time
@@ -172,11 +174,17 @@ testRoundTripParsing(String localeName, DateTime date) {
// as possible if it occurs again.
if (thenPrintAgain != actualResult) {
print("Date mismatch!");
+ print("Date creation log: $debugDateCreationLog");
+ debugDateCreationLog.clear();
print(" Expected $actualResult");
print(" Got $thenPrintAgain");
print(" Original date = $date");
print(" Original ms = ${date.millisecondsSinceEpoch}");
print(" Parsed back to $parsed");
+ var parsed2 = format.parse(actualResult);
+ print(" Parsing again yields $parsed2");
+ print(" Logged as: $debugDateCreationLog");
+ debugDateCreationLog.clear();
print(" Parsed ms = ${parsed.millisecondsSinceEpoch}");
print(" Original tz = $originalTimeZoneOffset");
print(" Current tz name = $originalTimeZoneName");
@@ -185,6 +193,7 @@ testRoundTripParsing(String localeName, DateTime date) {
print(" Start time = $originalTime");
print(" Current time ${new DateTime.now()}");
}
+ debugLogDateCreation = false;
expect(thenPrintAgain, equals(actualResult));
}
}
« no previous file with comments | « pkg/intl/lib/src/temporary_debugging.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698