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

Unified Diff: tests/corelib/format_exception_test.dart

Issue 2789523002: Fix edge cases where a FormatException source argument starts with a newline. (Closed)
Patch Set: Rename variables. Created 3 years, 9 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 | « sdk/lib/core/exceptions.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/format_exception_test.dart
diff --git a/tests/corelib/format_exception_test.dart b/tests/corelib/format_exception_test.dart
index 121494cadbf8edce916ece58ea7577df4c26d0be..0222b495b511ad4c1ecc7121e0206116181bf3aa 100644
--- a/tests/corelib/format_exception_test.dart
+++ b/tests/corelib/format_exception_test.dart
@@ -70,4 +70,18 @@ main() {
"FormatException: message (at line 10, character ${half + 1})\n"
"...${longline.substring(half - 36, half + 36)}...\n"
"${' ' * 39}^\n");
+
+ var sourceNL = "\nsource with leading NL";
+ e = new FormatException("message", sourceNL, 2);
+ test(e, "message", sourceNL, 2,
+ "FormatException: message (at line 2, character 2)\n"
+ "source with leading NL\n"
+ " ^\n");
+
+ var sourceNL2 = "\n\nsource with leading NL";
+ e = new FormatException("message", sourceNL2, 2);
+ test(e, "message", sourceNL2, 2,
+ "FormatException: message (at line 3, character 1)\n"
+ "source with leading NL\n"
+ "^\n");
}
« no previous file with comments | « sdk/lib/core/exceptions.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698