Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/js/src/jit-test/tests/basic/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  substring-inline-strings.js   Sprache: JAVA

 
let hasStringRepresentation = typeof stringRepresentation === "function";

function testLatin1() {
  var s = "abcdefghijklmnopqrstuvwxyz";
  for (var i = 0; i < 100; i++) {
    var sub8 = s.substring(0, 8);
    assertEq(sub8, "abcdefgh");
    if (hasStringRepresentation) {
      assertEq(stringRepresentation(sub8).includes("(JSThinInlineString*)"), true);
    }

    var sub24 = s.substring(0, 24);
    assertEq(sub24, "abcdefghijklmnopqrstuvwx");
    if (hasStringRepresentation) {
      assertEq(stringRepresentation(sub24).includes("(JSFatInlineString*)"), true);
    }

    var sub25 = s.substring(0, 25);
    assertEq(sub25, "abcdefghijklmnopqrstuvwxy");
    if (hasStringRepresentation) {
      assertEq(stringRepresentation(sub25).includes("(JSDependentString*)"), true);
    }
  }
}
testLatin1();

function testTwoByte() {
  var s = "\u1000bcdefghijklmnopqrstuvwxyz";
  for (var i = 0; i < 100; i++) {
    var sub4 = s.substring(0, 4);
    assertEq(sub4, "\u1000bcd");
    if (hasStringRepresentation) {
      assertEq(stringRepresentation(sub4).includes("(JSThinInlineString*)"), true);
    }

    var sub12 = s.substring(0, 12);
    assertEq(sub12, "\u1000bcdefghijkl");
    if (hasStringRepresentation) {
      assertEq(stringRepresentation(sub12).includes("(JSFatInlineString*)"), true);
    }

    var sub13 = s.substring(0, 13);
    assertEq(sub13, "\u1000bcdefghijklm");
    if (hasStringRepresentation) {
      assertEq(stringRepresentation(sub13).includes("(JSDependentString*)"), true);
    }
  }
}
testTwoByte();

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

¤ Dauer der Verarbeitung: 0.12 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.