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

Unified Diff: pkg/unittest/lib/unittest.dart

Issue 16408019: Improved error messages from unittest. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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
Index: pkg/unittest/lib/unittest.dart
===================================================================
--- pkg/unittest/lib/unittest.dart (revision 24002)
+++ pkg/unittest/lib/unittest.dart (working copy)
@@ -863,6 +863,12 @@
/** Signature for a test function. */
typedef dynamic TestFunction();
+/**
+ * A flag that controls whether we hide unittest details in exception stacks.
+ * Useful to disable when debugging unittest or matcher customizations.
+ */
+bool formatStacks = true;
+
// Stack formatting utility. Strips extraneous content from a stack trace.
// Stack frame lines are parsed with a regexp, which has been tested
// in Chrome, Firefox and the VM. If a line fails to be parsed it is
@@ -886,6 +892,9 @@
r'):([:\d]+)[\)]?$'); // Get the line number and optional column number.
String _formatStack(stack) {
+ if (!formatStacks) {
Siggi Cherem (dart-lang) 2013/06/14 01:20:56 nit: use fast-exit pattern if (!formatStacks) ret
+ return "$stack";
+ }
var lines;
if (stack is StackTrace) {
lines = stack.toString().split('\n');

Powered by Google App Engine
This is Rietveld 408576698