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

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
« no previous file with comments | « pkg/unittest/lib/src/string_matchers.dart ('k') | pkg/unittest/test/instance_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/unittest.dart
===================================================================
--- pkg/unittest/lib/unittest.dart (revision 24041)
+++ 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,7 @@
r'):([:\d]+)[\)]?$'); // Get the line number and optional column number.
String _formatStack(stack) {
+ if (!formatStacks) return "$stack";
var lines;
if (stack is StackTrace) {
lines = stack.toString().split('\n');
« no previous file with comments | « pkg/unittest/lib/src/string_matchers.dart ('k') | pkg/unittest/test/instance_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698