test_deduplicate.py (466B)
1 def WebIDLTest(parser, harness): 2 parser.parse( 3 """ 4 interface Foo; 5 interface Bar; 6 interface Foo; 7 """ 8 ) 9 10 results = parser.finish() 11 12 # There should be no duplicate interfaces in the result. 13 expectedNames = sorted(["Foo", "Bar"]) 14 actualNames = sorted(map(lambda iface: iface.identifier.name, results)) 15 harness.check( 16 actualNames, expectedNames, "Parser shouldn't output duplicate names." 17 )