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

Unified Diff: tests/lib/convert/html_escape_test.dart

Issue 1019853002: Document and fix HTML-escape. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: address comments. Created 5 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/convert/html_escape.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/convert/html_escape_test.dart
diff --git a/tests/lib/convert/html_escape_test.dart b/tests/lib/convert/html_escape_test.dart
index 674c781eac4d49096b5354e1b6c23794b4d26274..787ae345269aff1473afa17a7849ebebe5a8b83e 100644
--- a/tests/lib/convert/html_escape_test.dart
+++ b/tests/lib/convert/html_escape_test.dart
@@ -8,16 +8,19 @@ import 'dart:convert';
const _NOOP = 'Nothing_to_escape';
-const _TEST_INPUT = '<A </test> of \u00A0 "double" & \'single\' values>';
+const _TEST_INPUT = """<A </test> of \xA0 "double" & 'single' values>""";
-const _OUTPUT_UNKNOWN = '&lt;A &lt;&#x2F;test&gt; of &nbsp; &quot;double&quot; &amp; '
- '&#x27;single&#x27; values&gt;';
+const _OUTPUT_UNKNOWN = '&lt;A &lt;/test&gt; of \xA0 &quot;double&quot; &amp; '
+ '&#39;single&#39; values&gt;';
-const _OUTPUT_ATTRIBUTE = "<A </test> of &nbsp; &quot;double&quot; &amp; "
- "\'single\' values>";
+const _OUTPUT_ATTRIBUTE =
+ "<A </test> of \xA0 &quot;double&quot; &amp; 'single' values>";
-const _OUTPUT_ELEMENT = '&lt;A &lt;&#x2F;test&gt; of &nbsp; "double" &amp; '
- '\'single\' values&gt;';
+const _OUTPUT_SQ_ATTRIBUTE =
+ '<A </test> of \xA0 "double" &amp; &#39;single&#39; values>';
+
+const _OUTPUT_ELEMENT =
+ """&lt;A &lt;/test&gt; of \xA0 "double" &amp; 'single' values&gt;""";
void _testMode(HtmlEscape escape, String input, String expected) {
_testConvert(escape, input, expected);
@@ -80,6 +83,7 @@ void main() {
_testMode(const HtmlEscape(), _TEST_INPUT, _OUTPUT_UNKNOWN);
_testMode(const HtmlEscape(HtmlEscapeMode.UNKNOWN), _TEST_INPUT, _OUTPUT_UNKNOWN);
_testMode(const HtmlEscape(HtmlEscapeMode.ATTRIBUTE), _TEST_INPUT, _OUTPUT_ATTRIBUTE);
+ _testMode(const HtmlEscape(HtmlEscapeMode.SQ_ATTRIBUTE), _TEST_INPUT, _OUTPUT_SQ_ATTRIBUTE);
_testMode(const HtmlEscape(HtmlEscapeMode.ELEMENT), _TEST_INPUT, _OUTPUT_ELEMENT);
_testMode(HTML_ESCAPE, _NOOP, _NOOP);
}
« no previous file with comments | « sdk/lib/convert/html_escape.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698