def WebIDLTest(parser, harness):
parser.parse( """
namespace MyNamespace {
attribute any foo;
any bar();
}; """
)
results = parser.finish()
harness.check(len(results), 1, "Should have a thing.")
harness.ok(results[0].isNamespace(), "Our thing should be a namespace")
harness.check(len(results[0].members), 2, "Should have two things in our namespace")
harness.ok(results[0].members[0].isAttr(), "First member is attribute")
harness.ok(results[0].members[0].isStatic(), "Attribute should be static")
harness.ok(results[0].members[1].isMethod(), "Second member is method")
harness.ok(results[0].members[1].isStatic(), "Operation should be static")
results = parser.finish()
harness.check(len(results), 2, "Should have things.")
harness.ok(results[0].isNamespace(), "Our thing should be a namespace")
harness.check(len(results[0].members), 2, "Should have two things in our namespace")
harness.ok(results[0].members[0].isAttr(), "First member is attribute")
harness.ok(results[0].members[0].isStatic(), "Attribute should be static")
harness.ok(results[0].members[1].isMethod(), "Second member is method")
harness.ok(results[0].members[1].isStatic(), "Operation should be static")
results = parser.finish()
harness.check(len(results), 2, "Should have things.")
harness.ok(results[1].isNamespace(), "Our thing should be a namespace")
harness.check(len(results[1].members), 2, "Should have two things in our namespace")
harness.ok(results[1].members[0].isAttr(), "First member is attribute")
harness.ok(results[1].members[0].isStatic(), "Attribute should be static")
harness.ok(results[1].members[1].isMethod(), "Second member is method")
harness.ok(results[1].members[1].isStatic(), "Operation should be static")
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.