src/test/java/org/jsoup/nodes/NodeTest.java
/*
    Test for an issue with Java's abs URL handler.
     */
Test for an issue with Java's abs URL handler.
Test for an issue with Java ' s abs URL handler .
@Test public void absHandlesRelativeQuery() {
        Document doc = Jsoup.parse("<a href='?foo'>One</a> <a href='bar.html?foo'>Two</a>", "https://jsoup.org/path/file?bar");
        Element a1 = doc.select("a").first();
        assertEquals("https://jsoup.org/path/file?foo", a1.absUrl("href"));
        Element a2 = doc.select("a").get(1);
        assertEquals("https://jsoup.org/path/bar.html?foo", a2.absUrl("href"));
    }
@ Test public void absHandlesRelativeQuery ( ) { Document doc = Jsoup . parse ( "<a href='?foo'>One</a> <a href='bar.html?foo'>Two</a>" , "https://jsoup.org/path/file?bar" ) ; Element a1 = doc . select ( "a" ) . first ( ) ; assertEquals ( "https://jsoup.org/path/file?foo" , a1 . absUrl ( "href" ) ) ; Element a2 = doc . select ( "a" ) . get ( 1 ) ; assertEquals ( "https://jsoup.org/path/bar.html?foo" , a2 . absUrl ( "href" ) ) ; }
Test for an issue with Java's abs URL handler.
Test for an issue with Java ' s abs URL handler .