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

Unified Diff: runtime/bin/vmservice/observatory/test/string_escaping_test.dart

Issue 558853004: Preserve the contents of Dart strings with unmatched surrogate halfs by avoiding a UTF16 -> UTF8 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync and build Created 6 years, 3 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: runtime/bin/vmservice/observatory/test/string_escaping_test.dart
diff --git a/runtime/bin/vmservice/observatory/test/string_escaping_test.dart b/runtime/bin/vmservice/observatory/test/string_escaping_test.dart
index 41e2649276d323b12d20269463a450d424dfd25f..3b73a8c4ca38a1862a76583e5c14a8e5ba47c763 100644
--- a/runtime/bin/vmservice/observatory/test/string_escaping_test.dart
+++ b/runtime/bin/vmservice/observatory/test/string_escaping_test.dart
@@ -23,6 +23,8 @@ var nullInTheMiddle;
var escapedUnicodeEscape;
var longStringEven;
var longStringOdd;
+var malformedWithLeadSurrogate;
+var malformedWithTrailSurrogate;
void script() {
ascii = "Hello, World!";
@@ -42,6 +44,9 @@ void script() {
for (int i = 0; i < 512; i++) longStringEven += "𝄞";
longStringOdd = ".";
for (int i = 0; i < 512; i++) longStringOdd += "𝄞";
+
+ malformedWithLeadSurrogate = "before" + "𝄞"[0] + "after";
+ malformedWithTrailSurrogate = "before" + "𝄞"[1] + "after";
}
var tests = [
@@ -71,9 +76,11 @@ var tests = [
expectFullString('newLines', newLines);
expectFullString('tabs', tabs);
expectFullString('suggrogatePairs', suggrogatePairs);
- expectFullString('nullInTheMiddle', nullInTheMiddle); /// 01: ok
+ expectFullString('nullInTheMiddle', nullInTheMiddle);
expectTruncatedString('longStringEven', longStringEven);
expectTruncatedString('longStringOdd', longStringOdd);
+ expectFullString('malformedWithLeadSurrogate', malformedWithLeadSurrogate);
+ expectFullString('malformedWithTrailSurrogate', malformedWithTrailSurrogate);
}),
];

Powered by Google App Engine
This is Rietveld 408576698