MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / percent

Method percent

src/test/java/org/htmlunit/util/UrlUtilsTest.java:446–467  ·  view source on GitHub ↗

@throws Exception if the test fails

()

Source from the content-addressed store, hash-verified

444 * @throws Exception if the test fails
445 */
446 @Test
447 public void percent() throws Exception {
448 URL url = new URL("http://localhost/bug%21.html");
449 assertEquals("http://localhost/bug%21.html",
450 UrlUtils.encodeUrl(url, ISO_8859_1));
451
452 url = new URL("http://localhost/bug%0F.html");
453 assertEquals("http://localhost/bug%0F.html",
454 UrlUtils.encodeUrl(url, ISO_8859_1));
455
456 url = new URL("http://localhost/bug%ff.html");
457 assertEquals("http://localhost/bug%ff.html",
458 UrlUtils.encodeUrl(url, ISO_8859_1));
459
460 url = new URL("http://localhost/bug%AB.html");
461 assertEquals("http://localhost/bug%AB.html",
462 UrlUtils.encodeUrl(url, ISO_8859_1));
463
464 url = new URL("http://john.smith:secret@localhost/bug%AB.html");
465 assertEquals("http://john.smith:secret@localhost/bug%AB.html",
466 UrlUtils.encodeUrl(url, ISO_8859_1));
467 }
468
469 /**
470 * Tests for #1587.

Callers

nothing calls this directly

Calls 2

encodeUrlMethod · 0.95
assertEqualsMethod · 0.45

Tested by

no test coverage detected