diff options
author | Daijiro Wachi <daijiro.wachi@gmail.com> | 2019-01-21 00:24:29 +0900 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-01-20 09:24:29 -0600 |
commit | 9e1f5ccb8b06c01c1330ed38aeba83cfc51f5387 (patch) | |
tree | 0187470d3c7c9489132c0116d1ffe418036a7e8c /js/url_test.ts | |
parent | 7800d9f007b4d91b39ebcaba3388e8cc891adfa0 (diff) |
Use the same parse processing at contractor of URL with setters (#1549)
Diffstat (limited to 'js/url_test.ts')
-rw-r--r-- | js/url_test.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/url_test.ts b/js/url_test.ts index f89845274..2bfea6bef 100644 --- a/js/url_test.ts +++ b/js/url_test.ts @@ -31,6 +31,19 @@ test(function urlParsing() { ); }); +test(function constractorParsing() { + const url = new URL("http://どめいん.com/ぱす?きー=ばりゅー#はっしゅ"); + const { host, pathname, search, hash } = url; + url.host = "どめいん.com"; + url.pathname = "/ぱす"; + url.search = "?きー=ばりゅー"; + url.hash = "#はっしゅ"; + assertEqual(host, url.host); + assertEqual(pathname, url.pathname); + assertEqual(search, url.search); + assertEqual(hash, url.hash); +}); + test(function urlModifications() { const url = new URL( "https://foo:bar@baz.qat:8000/qux/quux?foo=bar&baz=12#qat" |