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

Unified Diff: tests/corelib/safe_to_string_test.dart

Issue 23116007: Make Error.safeToString convert control codes in strings to escapes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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
« sdk/lib/core/errors.dart ('K') | « sdk/lib/core/errors.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/safe_to_string_test.dart
diff --git a/tests/corelib/safe_to_string_test.dart b/tests/corelib/safe_to_string_test.dart
index 10be1f73a999a02570b51eeeb37eb9614bb2465b..233eb5dde1e993663227c756e3ab212a5a7c1aad 100644
--- a/tests/corelib/safe_to_string_test.dart
+++ b/tests/corelib/safe_to_string_test.dart
@@ -15,6 +15,16 @@ main() {
Expect.stringEquals(r'"\\\"\n\r"', Error.safeToString('\\"\n\r'));
+ Expect.stringEquals(r'"\x00\x01\x02\x03\x04\x05\x06\x07"',
+ Error.safeToString('\x00\x01\x02\x03\x04\x05\x06\x07'));
+ Expect.stringEquals(r'"\x08\t\n\x0b\x0c\r\x0e\x0f"',
+ Error.safeToString('\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f'));
+ Expect.stringEquals(r'"\x10\x11\x12\x13\x14\x15\x16\x17"',
+ Error.safeToString('\x10\x11\x12\x13\x14\x15\x16\x17'));
+ Expect.stringEquals(r'"\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f"',
+ Error.safeToString('\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'));
+ Expect.stringEquals('" "', Error.safeToString(" "));
+
Expect.stringEquals('null', Error.safeToString(null));
Expect.stringEquals('true', Error.safeToString(true));
Expect.stringEquals('false', Error.safeToString(false));
« sdk/lib/core/errors.dart ('K') | « sdk/lib/core/errors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698