dom/bindings/parser/tests/test_deduplicate.py
author Kyle Huey <khuey@kylehuey.com>
Thu, 12 Apr 2012 15:14:10 -0700
changeset 91506 d26c0cd1dfa3a2c277d8d3713774febff1054db7
parent 90979 3a0940f904553197a95534bf8ac153bc691766b4
child 1702735 dd3558a8f7ae3211ac8a9ad5f87196d6a00e7a95
child 1987889 0797657470cb868f28dacd2e9fd77baa91cabc2e
child 2103140 bc374397c8143b3be8f72d487248fde49df6388b
child 2103238 9d1695eade46f00a300aa02792c75db78ae7cae3
permissions -rw-r--r--
Bug 741125: Update WebIDL parser.

import WebIDL

def WebIDLTest(parser, harness):
    parser.parse("""
        interface Foo;
        interface Bar;
        interface Foo;
        """);

    results = parser.finish()

    # There should be no duplicate interfaces in the result.
    expectedNames = sorted(['Foo', 'Bar'])
    actualNames = sorted(map(lambda iface: iface.identifier.name, results))
    harness.check(actualNames, expectedNames, "Parser shouldn't output duplicate names.")