Index: tests/corelib/format_exception_test.dart |
diff --git a/tests/corelib/format_exception_test.dart b/tests/corelib/format_exception_test.dart |
index 0222b495b511ad4c1ecc7121e0206116181bf3aa..a2e89e6194cca793fa7a7d2abb2a33c5547ea384 100644 |
--- a/tests/corelib/format_exception_test.dart |
+++ b/tests/corelib/format_exception_test.dart |
@@ -3,6 +3,7 @@ |
// BSD-style license that can be found in the LICENSE file. |
library format_exception_test; |
+ |
import "package:expect/expect.dart"; |
test(exn, message, source, offset, toString) { |
@@ -28,14 +29,14 @@ main() { |
test(e, "message", "source", null, "FormatException: message\nsource"); |
e = new FormatException("message", "source" * 25); |
- test(e, "message", "source" * 25, null, "FormatException: message\n" + |
- "source" * 12 + "sou..."); |
+ test(e, "message", "source" * 25, null, |
+ "FormatException: message\n" + "source" * 12 + "sou..."); |
e = new FormatException("message", "source" * 25); |
- test(e, "message", "source" * 25, null, "FormatException: message\n" + |
- "source" * 12 + "sou..."); |
+ test(e, "message", "source" * 25, null, |
+ "FormatException: message\n" + "source" * 12 + "sou..."); |
e = new FormatException("message", "s1\nsource\ns2"); |
- test(e, "message", "s1\nsource\ns2", null, "FormatException: message\n" + |
- "s1\nsource\ns2"); |
+ test(e, "message", "s1\nsource\ns2", null, |
+ "FormatException: message\n" + "s1\nsource\ns2"); |
var o = new Object(); |
e = new FormatException("message", o, 10); |
@@ -43,45 +44,65 @@ main() { |
e = new FormatException("message", "source", 3); |
test(e, "message", "source", 3, |
- "FormatException: message (at character 4)\nsource\n ^\n"); |
+ "FormatException: message (at character 4)\nsource\n ^\n"); |
e = new FormatException("message", "s1\nsource\ns2", 6); |
test(e, "message", "s1\nsource\ns2", 6, |
- "FormatException: message (at line 2, character 4)\nsource\n ^\n"); |
+ "FormatException: message (at line 2, character 4)\nsource\n ^\n"); |
- var longline = "watermelon cantaloupe " * 8 + "watermelon"; // Length > 160. |
+ var longline = "watermelon cantaloupe " * 8 + "watermelon"; // Length > 160. |
var longsource = (longline + "\n") * 25; |
var line10 = (longline.length + 1) * 9; |
e = new FormatException("message", longsource, line10); |
- test(e, "message", longsource, line10, |
- "FormatException: message (at line 10, character 1)\n" |
- "${longline.substring(0, 75)}...\n^\n"); |
+ test( |
+ e, |
+ "message", |
+ longsource, |
+ line10, |
+ "FormatException: message (at line 10, character 1)\n" |
+ "${longline.substring(0, 75)}...\n^\n"); |
e = new FormatException("message", longsource, line10 - 1); |
- test(e, "message", longsource, line10 - 1, |
- "FormatException: message (at line 9, " |
- "character ${longline.length + 1})\n" |
- "...${longline.substring(longline.length - 75)}\n" |
- "${' ' * 78}^\n"); |
+ test( |
+ e, |
+ "message", |
+ longsource, |
+ line10 - 1, |
+ "FormatException: message (at line 9, " |
+ "character ${longline.length + 1})\n" |
+ "...${longline.substring(longline.length - 75)}\n" |
+ "${' ' * 78}^\n"); |
var half = longline.length ~/ 2; |
e = new FormatException("message", longsource, line10 + half); |
- test(e, "message", longsource, line10 + half, |
- "FormatException: message (at line 10, character ${half + 1})\n" |
- "...${longline.substring(half - 36, half + 36)}...\n" |
- "${' ' * 39}^\n"); |
+ test( |
+ e, |
+ "message", |
+ longsource, |
+ line10 + half, |
+ "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"); |
+ 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"); |
+ test( |
+ e, |
+ "message", |
+ sourceNL2, |
+ 2, |
+ "FormatException: message (at line 3, character 1)\n" |
+ "source with leading NL\n" |
+ "^\n"); |
} |