dom/bindings/parser/tests/test_interface_identifier_conflicts_across_members.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/bindings/parser/tests/test_interface_identifier_conflicts_across_members.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +def WebIDLTest(parser, harness):
     1.5 +    threw = False
     1.6 +    try:
     1.7 +        parser.parse("""
     1.8 +            interface IdentifierConflictAcrossMembers1 {
     1.9 +              const byte thing1 = 1;
    1.10 +              readonly attribute long thing1;
    1.11 +            };
    1.12 +        """)
    1.13 +
    1.14 +        results = parser.finish()
    1.15 +    except:
    1.16 +        threw = True
    1.17 +
    1.18 +    harness.ok(threw, "Should have thrown.")
    1.19 +
    1.20 +    threw = False
    1.21 +    try:
    1.22 +        parser.parse("""
    1.23 +            interface IdentifierConflictAcrossMembers2 {
    1.24 +              readonly attribute long thing1;
    1.25 +              const byte thing1 = 1;
    1.26 +            };
    1.27 +        """)
    1.28 +
    1.29 +        results = parser.finish()
    1.30 +    except:
    1.31 +        threw = True
    1.32 +
    1.33 +    harness.ok(threw, "Should have thrown.")
    1.34 +
    1.35 +    threw = False
    1.36 +    try:
    1.37 +        parser.parse("""
    1.38 +            interface IdentifierConflictAcrossMembers3 {
    1.39 +              getter boolean thing1(DOMString name);
    1.40 +              readonly attribute long thing1;
    1.41 +            };
    1.42 +        """)
    1.43 +
    1.44 +        results = parser.finish()
    1.45 +    except:
    1.46 +        threw = True
    1.47 +
    1.48 +    harness.ok(threw, "Should have thrown.")
    1.49 +
    1.50 +    threw = False
    1.51 +    try:
    1.52 +        parser.parse("""
    1.53 +            interface IdentifierConflictAcrossMembers1 {
    1.54 +              const byte thing1 = 1;
    1.55 +              long thing1();
    1.56 +            };
    1.57 +        """)
    1.58 +
    1.59 +        results = parser.finish()
    1.60 +    except:
    1.61 +        threw = True
    1.62 +
    1.63 +    harness.ok(threw, "Should have thrown.")

mercurial