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

Unified Diff: test/mjsunit/uri.js

Issue 1968953002: [runtime] Implement encodeURI as single runtime function. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix isalnum() bug Created 4 years, 7 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
« test/mjsunit/messages.js ('K') | « test/mjsunit/messages.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/uri.js
diff --git a/test/mjsunit/uri.js b/test/mjsunit/uri.js
index 862e420f892473c7465b1822f860d49f49e92ace..4a4f041379a327e7d64be7c1808610bd6ec58b74 100644
--- a/test/mjsunit/uri.js
+++ b/test/mjsunit/uri.js
@@ -53,9 +53,9 @@ var s9 = String.fromCharCode(cc9_1)+String.fromCharCode(cc9_2);
var cc10 = 0xE000;
var s10 = String.fromCharCode(cc10);
-assertEquals('%7D', encodeURI(s1));
-assertEquals('%00', encodeURI(s2));
-assertEquals('%C2%80', encodeURI(s3));
+assertEquals('%7D', encodeURI(s1)); // }
Yang 2016/05/12 07:39:21 We usually use two whitespaces before a comment.
Franzi 2016/05/13 09:42:03 Done.
+assertEquals('%00', encodeURI(s2)); // 0
+assertEquals('%C2%80', encodeURI(s3)); // Padding character
assertEquals('%D5%95', encodeURI(s4));
assertEquals('%DF%BF', encodeURI(s5));
assertEquals('%E0%A0%80', encodeURI(s6));
@@ -64,6 +64,9 @@ assertEquals('%F0%90%80%80', encodeURI(s8));
assertEquals('%F4%8F%BF%BF', encodeURI(s9));
assertEquals('%EE%80%80', encodeURI(s10));
+assertEquals('Hello%20World!', encodeURI("Hello World!"));
+
+
assertEquals(cc1, decodeURI(encodeURI(s1)).charCodeAt(0));
assertEquals(cc2, decodeURI(encodeURI(s2)).charCodeAt(0));
assertEquals(cc3, decodeURI(encodeURI(s3)).charCodeAt(0));
@@ -80,14 +83,14 @@ assertEquals(cc10, decodeURI(encodeURI(s10)).charCodeAt(0));
assertEquals("", decodeURI(""));
assertEquals("", encodeURI(""));
-function test(string) {
+function testIdempotent(string) {
assertEquals(string, decodeURI(encodeURI(string)));
}
-test("\u1234\u0123\uabcd");
-test("abcd");
-test("ab<\u1234\u0123");
-test("ab\u1234<\u0123");
+testIdempotent("\u1234\u0123\uabcd");
+testIdempotent("abcd");
+testIdempotent("ab<\u1234\u0123");
+testIdempotent("ab\u1234<\u0123");
(function TestDeleteCharCodeAt() {
« test/mjsunit/messages.js ('K') | « test/mjsunit/messages.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698