1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 15:24:46 -05:00

test(url_test): disable no-self-assign rule here (#7204)

This commit is contained in:
Yusuke Tanaka 2020-08-27 04:01:03 +09:00 committed by GitHub
parent 4a0bc747dd
commit 6d964fc607
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -183,10 +183,13 @@ unitTest(function urlNormalize(): void {
unitTest(function urlModifyPathname(): void { unitTest(function urlModifyPathname(): void {
const url = new URL("http://foo.bar/baz%qat/qux%quux"); const url = new URL("http://foo.bar/baz%qat/qux%quux");
assertEquals(url.pathname, "/baz%qat/qux%quux"); assertEquals(url.pathname, "/baz%qat/qux%quux");
// Self-assignment is to invoke the setter.
// deno-lint-ignore no-self-assign
url.pathname = url.pathname; url.pathname = url.pathname;
assertEquals(url.pathname, "/baz%qat/qux%quux"); assertEquals(url.pathname, "/baz%qat/qux%quux");
url.pathname = "baz#qat qux"; url.pathname = "baz#qat qux";
assertEquals(url.pathname, "/baz%23qat%20qux"); assertEquals(url.pathname, "/baz%23qat%20qux");
// deno-lint-ignore no-self-assign
url.pathname = url.pathname; url.pathname = url.pathname;
assertEquals(url.pathname, "/baz%23qat%20qux"); assertEquals(url.pathname, "/baz%23qat%20qux");
}); });
@ -195,6 +198,7 @@ unitTest(function urlModifyHash(): void {
const url = new URL("http://foo.bar"); const url = new URL("http://foo.bar");
url.hash = "%foo bar/qat%qux#bar"; url.hash = "%foo bar/qat%qux#bar";
assertEquals(url.hash, "#%foo%20bar/qat%qux#bar"); assertEquals(url.hash, "#%foo%20bar/qat%qux#bar");
// deno-lint-ignore no-self-assign
url.hash = url.hash; url.hash = url.hash;
assertEquals(url.hash, "#%foo%20bar/qat%qux#bar"); assertEquals(url.hash, "#%foo%20bar/qat%qux#bar");
}); });