for type in JsonTypes:
doTest( "interface Test { %s toJSON(); };" % type, False, "%s should be a JSON type" % type,
)
doTest( "interface Test { sequence<%s> toJSON(); };" % type, False, "sequence<%s> should be a JSON type" % type,
)
doTest( "dictionary Foo { %s foo; }; ""interface Test { Foo toJSON(); }; " % type, False, "dictionary containing only JSON type (%s) should be a JSON type" % type,
)
doTest( "dictionary Foo { %s foo; }; dictionary Bar : Foo { }; " "interface Test { Bar toJSON(); }; " % type, False, "dictionary whose ancestors only contain JSON types should be a JSON type",
)
doTest( "dictionary Foo { any foo; }; dictionary Bar : Foo { %s bar; };" "interface Test { Bar toJSON(); };" % type, True, "dictionary whose ancestors contain non-JSON types should not be a JSON type",
)
doTest( "interface Test { record toJSON(); };" % type, False, "record should be a JSON type" % type,
)
doTest( "interface Test { record toJSON(); };" % type, False, "record should be a JSON type" % type,
)
doTest( "interface Test { record toJSON(); };" % type, False, "record should be a JSON type" % type,
)
doTest( "interface Test { record toJSON(); };" % type, False, "record should be a JSON type" % type,
)
otherUnionType = "Foo"if type != "object"else"long"
doTest( "interface Foo { object toJSON(); };" "interface Test { (%s or %s) toJSON(); };" % (otherUnionType, type), False, "union containing only JSON types (%s or %s) should be a JSON type"
% (otherUnionType, type),
)
doTest( "interface test { %s? toJSON(); };" % type, False, "Nullable type (%s) should be a JSON type" % type,
)
doTest( "interface Foo : InterfaceWithoutToJSON { %s toJSON(); };" "interface Test { Foo toJSON(); };" % type, False, "interface with toJSON should be a JSON type",
)
doTest( "interface Foo : InterfaceWithToJSON { };""interface Test { Foo toJSON(); };", False, "inherited interface with toJSON should be a JSON type",
)
for type in nonJsonTypes:
doTest( "interface Test { %s toJSON(); };" % type, True, "%s should not be a JSON type" % type,
)
doTest( "interface Test { sequence<%s> toJSON(); };" % type, True, "sequence<%s> should not be a JSON type" % type,
)
doTest( "dictionary Foo { %s foo; }; ""interface Test { Foo toJSON(); }; " % type, True, "Dictionary containing a non-JSON type (%s) should not be a JSON type"
% type,
)
doTest( "dictionary Foo { %s foo; }; dictionary Bar : Foo { }; " "interface Test { Bar toJSON(); }; " % type, True, "dictionary whose ancestors only contain non-JSON types should not be a JSON type",
)
doTest( "interface Test { record toJSON(); };" % type, True, "record should not be a JSON type" % type,
)
doTest( "interface Test { record toJSON(); };" % type, True, "record should not be a JSON type" % type,
)
doTest( "interface Test { record toJSON(); };" % type, True, "record should not be a JSON type" % type,
)
if type != "any":
doTest( "interface Foo { object toJSON(); }; " "interface Test { (Foo or %s) toJSON(); };" % type, True, "union containing a non-JSON type (%s) should not be a JSON type"
% type,
)
doTest( "interface test { %s? toJSON(); };" % type, True, "Nullable type (%s) should not be a JSON type" % type,
)
doTest( "dictionary Foo { long foo; any bar; };""interface Test { Foo toJSON(); };", True, "dictionary containing a non-JSON type should not be a JSON type",
)
doTest( "interface Foo : InterfaceWithoutToJSON { }; " "interface Test { Foo toJSON(); };", True, "interface without toJSON should not be a JSON type",
)
Messung V0.5
¤ Dauer der Verarbeitung: 0.19 Sekunden
(vorverarbeitet)
¤
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.