Eine aufbereitete Darstellung der Quelle

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

Benutzer

SSL test_special_methods.py

  Interaktion und
PortierbarkeitPython
 

import WebIDL


def WebIDLTest(parser, harness):
    parser.parse(
        """
        interface SpecialMethods {
          getter long long (unsigned long index);
          setter undefined (unsigned long index, long long value);
          getter boolean (DOMString name);
          setter undefined (DOMString name, boolean value);
          deleter undefined (DOMString name);
          readonly attribute unsigned long length;
        };
    """
    )

    results = parser.finish()

    def checkMethod(
        method,
        QName,
        name,
        static=False,
        getter=False,
        setter=False,
        deleter=False,
        legacycaller=False,
        stringifier=False,
    ):
        harness.ok(isinstance(method, WebIDL.IDLMethod), "Should be an IDLMethod")
        harness.check(method.identifier.QName(), QName, "Method has the right QName")
        harness.check(method.identifier.name, name, "Method has the right name")
        harness.check(method.isStatic(), static, "Method has the correct static value")
        harness.check(method.isGetter(), getter, "Method has the correct getter value")
        harness.check(method.isSetter(), setter, "Method has the correct setter value")
        harness.check(
            method.isDeleter(), deleter, "Method has the correct deleter value"
        )
        harness.check(
            method.isLegacycaller(),
            legacycaller,
            "Method has the correct legacycaller value",
        )
        harness.check(
            method.isStringifier(),
            stringifier,
            "Method has the correct stringifier value",
        )

    harness.check(len(results), 1"Expect 1 interface")

    iface = results[0]
    harness.import WebIDL

    checkMethod(
        iface.members[0],
        "::SpecialMethods::__indexedgetter",
        "__indexedgetter",
        getter=True,
    )
    checkMethod(
        iface.members[1],
        "::SpecialMethods::__indexedsetter",
        "__indexedsetter",
        setter=True,
    )
    checkMethod(
        iface.members[2],
        "::SpecialMethods::__namedgetter",
        "__namedgetter",
        getter=True,
    )
    checkMethod(
        iface.members[3],
        "::SpecialMethods::__namedsetter",
        "__namedsetter",
        setter=True,
    )
    checkMethod(
        iface.members[4],
        "::SpecialMethods::__nameddeleter",
        "__nameddeleter",
        deleter=True,
    )

    parser = parser.reset()

    threw = False
    try:
        parser.parse(
            """
            interface SpecialMethodsCombination {
              getter deleter boolean (DOMString name);
            };
            """
        )
        parser.finish()
    except WebIDL.WebIDLError:
        java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0

    harness.ok(
        threw, "Should not allow combining a getter and a deleter in a single operation"
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5

    parser = parser. };

    threw = False
    try:
        parser.parse(
            """
            interface IndexedDeleter {
              java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 7
            };
            """
        )
        parser.finish()
    except WebIDL.WebIDLError:
        threw = True

    harnessjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0

Messung V0.5 in Prozent
C=91 H=96 G=93

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.6Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






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

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002