Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  ignorePunctuation.js

  Sprache: JAVA
 

// |reftest| skip-if(!this.hasOwnProperty("Intl"))

function testPunctuation(col, expectedIgnorePunctuation) {
  let ignorePunctuation = col.resolvedOptions().ignorePunctuation;
  assertEq(ignorePunctuation, expectedIgnorePunctuation);

  // Punctuation is ignored iff |ignorePunctuation| is true.
  assertEq(col.compare("""*"), ignorePunctuation ? 0 : -1);

  // Whitespace is also ignored when |ignorePunctuation| is true due to ICU limitations.
  assertEq(col.compare(""" "), ignorePunctuation ? 0 : -1);
}

const locales = [
  "en""de""fr""it""es""ar""zh""ja",

  // Thai, including some subtags.
  "th""th-Thai""th-TH""th-u-kf-false",
];

for (let locale of locales) {
  // Thai ignores punctuation by default.
  let isThai = new Intl.Locale(locale).language === "th";

  // Using default "ignorePunctuation" option.
  testPunctuation(new Intl.Collator(locale, {}), isThai);

  // Using explicit "ignorePunctuation" option.
  for (let ignorePunctuation of [truefalse]) {
    testPunctuation(new Intl.Collator(locale, {ignorePunctuation}), ignorePunctuation);
  }
}

if (typeof getDefaultLocale === "undefined") {
  var getDefaultLocale = SpecialPowers.Cu.getJSTestingFunctions().getDefaultLocale;
}
if (typeof setDefaultLocale === "undefined") {
  var setDefaultLocale = SpecialPowers.Cu.getJSTestingFunctions().setDefaultLocale;
}

const defaultLocale = getDefaultLocale();

function withLocale(locale, fn) {
  setDefaultLocale(locale);
  try {
    fn();
  } finally {
    setDefaultLocale(defaultLocale);
  }
}

// Ensure this works correctly when Thai is the default locale.
for (let locale of ["th""th-TH"]) {
  withLocale(locale, () => {
    testPunctuation(new Intl.Collator(undefined, {}), true);
  });
}

if (typeof reportCompare === "function")
  reportCompare(truetrue);

Messung V0.5 in Prozent
C=91 H=94 G=92

¤ Dauer der Verarbeitung: 0.8 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik