test_argument_keywords.py (687B)
1 def WebIDLTest(parser, harness): 2 parser.parse( 3 """ 4 interface Foo { 5 undefined foo(object constructor); 6 }; 7 """ 8 ) 9 10 results = parser.finish() 11 harness.check(len(results), 1, "Should have an interface") 12 iface = results[0] 13 harness.check(len(iface.members), 1, "Should have an operation") 14 operation = iface.members[0] 15 harness.check(len(operation.signatures()), 1, "Should have one signature") 16 (retval, args) = operation.signatures()[0] 17 harness.check(len(args), 1, "Should have an argument") 18 harness.check( 19 args[0].identifier.name, 20 "constructor", 21 "Should have an identifier named 'constructor'", 22 )