dom/bindings/parser/tests/test_interface_identifier_conflicts_across_members.py

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:a25378d62c39
1 def WebIDLTest(parser, harness):
2 threw = False
3 try:
4 parser.parse("""
5 interface IdentifierConflictAcrossMembers1 {
6 const byte thing1 = 1;
7 readonly attribute long thing1;
8 };
9 """)
10
11 results = parser.finish()
12 except:
13 threw = True
14
15 harness.ok(threw, "Should have thrown.")
16
17 threw = False
18 try:
19 parser.parse("""
20 interface IdentifierConflictAcrossMembers2 {
21 readonly attribute long thing1;
22 const byte thing1 = 1;
23 };
24 """)
25
26 results = parser.finish()
27 except:
28 threw = True
29
30 harness.ok(threw, "Should have thrown.")
31
32 threw = False
33 try:
34 parser.parse("""
35 interface IdentifierConflictAcrossMembers3 {
36 getter boolean thing1(DOMString name);
37 readonly attribute long thing1;
38 };
39 """)
40
41 results = parser.finish()
42 except:
43 threw = True
44
45 harness.ok(threw, "Should have thrown.")
46
47 threw = False
48 try:
49 parser.parse("""
50 interface IdentifierConflictAcrossMembers1 {
51 const byte thing1 = 1;
52 long thing1();
53 };
54 """)
55
56 results = parser.finish()
57 except:
58 threw = True
59
60 harness.ok(threw, "Should have thrown.")

mercurial