Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/url/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  url-constructor.any.js

  Sprache: JAVA
 

// META: script=/common/subset-tests-by-key.js
// META: timeout=long
// META: variant=?include=file
// META: variant=?include=javascript
// META: variant=?include=mailto
// META: variant=?exclude=(file|javascript|mailto)

function runURLTests(urlTests) {
  for (const expected of urlTests) {
    // Skip comments
    if (typeof expected === "string")
      continue;

    const base = expected.base !== null ? expected.base : undefined;

    function getKey(expected) {
      if (expected.protocol) {
        return expected.protocol.replace(":""");
      }
      if (expected.failure) {
        return expected.input.split(":")[0];
      }
      return "other";
    }

    subsetTestByKey(getKey(expected), test, function() {
      if (expected.failure) {
        assert_throws_js(TypeError, function() {
          new URL(expected.input, base);
        });
        return;
      }

      const url = new URL(expected.input, base);
      assert_equals(url.href, expected.href, "href")
      assert_equals(url.protocol, expected.protocol, "protocol")
      assert_equals(url.username, expected.username, "username")
      assert_equals(url.password, expected.password, "password")
      assert_equals(url.host, expected.host, "host")
      assert_equals(url.hostname, expected.hostname, "hostname")
      assert_equals(url.port, expected.port, "port")
      assert_equals(url.pathname, expected.pathname, "pathname")
      assert_equals(url.search, expected.search, "search")
      if ("searchParams" in expected) {
        assert_true("searchParams" in url)
        assert_equals(url.searchParams.toString(), expected.searchParams, "searchParams")
      }
      assert_equals(url.hash, expected.hash, "hash")
    }, `Parsing: <${expected.input}> ${base ? "against <" + base + ">" : "without base"}`)
  }
}

promise_test(() => Promise.all([
  fetch("resources/urltestdata.json").then(res => res.json()),
  fetch("resources/urltestdata-javascript-only.json").then(res => res.json()),
]).then((tests) => tests.flat()).then(runURLTests), "Loading data…");

Messung V0.5 in Prozent
C=83 H=98 G=90

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.