dom/bindings/parser/tests/test_special_method_signature_mismatch.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/bindings/parser/tests/test_special_method_signature_mismatch.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,294 @@
     1.4 +def WebIDLTest(parser, harness):
     1.5 +    threw = False
     1.6 +    try:
     1.7 +        parser.parse("""
     1.8 +            interface SpecialMethodSignatureMismatch1 {
     1.9 +              getter long long foo(long index);
    1.10 +            };
    1.11 +        """)
    1.12 +
    1.13 +        results = parser.finish()
    1.14 +    except:
    1.15 +        threw = True
    1.16 +
    1.17 +    harness.ok(threw, "Should have thrown.")
    1.18 +
    1.19 +    threw = False
    1.20 +    try:
    1.21 +        parser.parse("""
    1.22 +            interface SpecialMethodSignatureMismatch2 {
    1.23 +              getter void foo(unsigned long index);
    1.24 +            };
    1.25 +        """)
    1.26 +
    1.27 +        results = parser.finish()
    1.28 +    except:
    1.29 +        threw = True
    1.30 +
    1.31 +    harness.ok(threw, "Should have thrown.")
    1.32 +
    1.33 +    threw = False
    1.34 +    try:
    1.35 +        parser.parse("""
    1.36 +            interface SpecialMethodSignatureMismatch3 {
    1.37 +              getter boolean foo(unsigned long index, boolean extraArg);
    1.38 +            };
    1.39 +        """)
    1.40 +
    1.41 +        results = parser.finish()
    1.42 +    except:
    1.43 +        threw = True
    1.44 +
    1.45 +    harness.ok(threw, "Should have thrown.")
    1.46 +
    1.47 +    threw = False
    1.48 +    try:
    1.49 +        parser.parse("""
    1.50 +            interface SpecialMethodSignatureMismatch4 {
    1.51 +              getter boolean foo(unsigned long... index);
    1.52 +            };
    1.53 +        """)
    1.54 +
    1.55 +        results = parser.finish()
    1.56 +    except:
    1.57 +        threw = True
    1.58 +
    1.59 +    harness.ok(threw, "Should have thrown.")
    1.60 +
    1.61 +    threw = False
    1.62 +    try:
    1.63 +        parser.parse("""
    1.64 +            interface SpecialMethodSignatureMismatch5 {
    1.65 +              getter boolean foo(optional unsigned long index);
    1.66 +            };
    1.67 +        """)
    1.68 +
    1.69 +        results = parser.finish()
    1.70 +    except:
    1.71 +        threw = True
    1.72 +
    1.73 +    harness.ok(threw, "Should have thrown.")
    1.74 +
    1.75 +    threw = False
    1.76 +    try:
    1.77 +        parser.parse("""
    1.78 +            interface SpecialMethodSignatureMismatch6 {
    1.79 +              getter boolean foo();
    1.80 +            };
    1.81 +        """)
    1.82 +
    1.83 +        results = parser.finish()
    1.84 +    except:
    1.85 +        threw = True
    1.86 +
    1.87 +    harness.ok(threw, "Should have thrown.")
    1.88 +
    1.89 +    threw = False
    1.90 +    try:
    1.91 +        parser.parse("""
    1.92 +            interface SpecialMethodSignatureMismatch7 {
    1.93 +              deleter long long foo(long index);
    1.94 +            };
    1.95 +        """)
    1.96 +
    1.97 +        results = parser.finish()
    1.98 +    except:
    1.99 +        threw = True
   1.100 +
   1.101 +    harness.ok(threw, "Should have thrown.")
   1.102 +
   1.103 +    threw = False
   1.104 +    try:
   1.105 +        parser.parse("""
   1.106 +            interface SpecialMethodSignatureMismatch9 {
   1.107 +              deleter boolean foo(unsigned long index, boolean extraArg);
   1.108 +            };
   1.109 +        """)
   1.110 +
   1.111 +        results = parser.finish()
   1.112 +    except:
   1.113 +        threw = True
   1.114 +
   1.115 +    harness.ok(threw, "Should have thrown.")
   1.116 +
   1.117 +    threw = False
   1.118 +    try:
   1.119 +        parser.parse("""
   1.120 +            interface SpecialMethodSignatureMismatch10 {
   1.121 +              deleter boolean foo(unsigned long... index);
   1.122 +            };
   1.123 +        """)
   1.124 +
   1.125 +        results = parser.finish()
   1.126 +    except:
   1.127 +        threw = True
   1.128 +
   1.129 +    harness.ok(threw, "Should have thrown.")
   1.130 +
   1.131 +    threw = False
   1.132 +    try:
   1.133 +        parser.parse("""
   1.134 +            interface SpecialMethodSignatureMismatch11 {
   1.135 +              deleter boolean foo(optional unsigned long index);
   1.136 +            };
   1.137 +        """)
   1.138 +
   1.139 +        results = parser.finish()
   1.140 +    except:
   1.141 +        threw = True
   1.142 +
   1.143 +    harness.ok(threw, "Should have thrown.")
   1.144 +
   1.145 +    threw = False
   1.146 +    try:
   1.147 +        parser.parse("""
   1.148 +            interface SpecialMethodSignatureMismatch12 {
   1.149 +              deleter boolean foo();
   1.150 +            };
   1.151 +        """)
   1.152 +
   1.153 +        results = parser.finish()
   1.154 +    except:
   1.155 +        threw = True
   1.156 +
   1.157 +    harness.ok(threw, "Should have thrown.")
   1.158 +
   1.159 +    threw = False
   1.160 +    try:
   1.161 +        parser.parse("""
   1.162 +            interface SpecialMethodSignatureMismatch13 {
   1.163 +              setter long long foo(long index, long long value);
   1.164 +            };
   1.165 +        """)
   1.166 +
   1.167 +        results = parser.finish()
   1.168 +    except:
   1.169 +        threw = True
   1.170 +
   1.171 +    harness.ok(threw, "Should have thrown.")
   1.172 +
   1.173 +    threw = False
   1.174 +    try:
   1.175 +        parser.parse("""
   1.176 +            interface SpecialMethodSignatureMismatch15 {
   1.177 +              setter boolean foo(unsigned long index, boolean value, long long extraArg);
   1.178 +            };
   1.179 +        """)
   1.180 +
   1.181 +        results = parser.finish()
   1.182 +    except:
   1.183 +        threw = True
   1.184 +
   1.185 +    harness.ok(threw, "Should have thrown.")
   1.186 +
   1.187 +    threw = False
   1.188 +    try:
   1.189 +        parser.parse("""
   1.190 +            interface SpecialMethodSignatureMismatch16 {
   1.191 +              setter boolean foo(unsigned long index, boolean... value);
   1.192 +            };
   1.193 +        """)
   1.194 +
   1.195 +        results = parser.finish()
   1.196 +    except:
   1.197 +        threw = True
   1.198 +
   1.199 +    harness.ok(threw, "Should have thrown.")
   1.200 +
   1.201 +    threw = False
   1.202 +    try:
   1.203 +        parser.parse("""
   1.204 +            interface SpecialMethodSignatureMismatch17 {
   1.205 +              setter boolean foo(unsigned long index, optional boolean value);
   1.206 +            };
   1.207 +        """)
   1.208 +
   1.209 +        results = parser.finish()
   1.210 +    except:
   1.211 +        threw = True
   1.212 +
   1.213 +    harness.ok(threw, "Should have thrown.")
   1.214 +
   1.215 +    threw = False
   1.216 +    try:
   1.217 +        parser.parse("""
   1.218 +            interface SpecialMethodSignatureMismatch18 {
   1.219 +              setter boolean foo();
   1.220 +            };
   1.221 +        """)
   1.222 +
   1.223 +        results = parser.finish()
   1.224 +    except:
   1.225 +        threw = True
   1.226 +
   1.227 +    harness.ok(threw, "Should have thrown.")
   1.228 +
   1.229 +    threw = False
   1.230 +    try:
   1.231 +        parser.parse("""
   1.232 +            interface SpecialMethodSignatureMismatch20 {
   1.233 +              creator long long foo(long index, long long value);
   1.234 +            };
   1.235 +        """)
   1.236 +
   1.237 +        results = parser.finish()
   1.238 +    except:
   1.239 +        threw = True
   1.240 +
   1.241 +    harness.ok(threw, "Should have thrown.")
   1.242 +
   1.243 +    threw = False
   1.244 +    try:
   1.245 +        parser.parse("""
   1.246 +            interface SpecialMethodSignatureMismatch22 {
   1.247 +              creator boolean foo(unsigned long index, boolean value, long long extraArg);
   1.248 +            };
   1.249 +        """)
   1.250 +
   1.251 +        results = parser.finish()
   1.252 +    except:
   1.253 +        threw = True
   1.254 +
   1.255 +    harness.ok(threw, "Should have thrown.")
   1.256 +
   1.257 +    threw = False
   1.258 +    try:
   1.259 +        parser.parse("""
   1.260 +            interface SpecialMethodSignatureMismatch23 {
   1.261 +              creator boolean foo(unsigned long index, boolean... value);
   1.262 +            };
   1.263 +        """)
   1.264 +
   1.265 +        results = parser.finish()
   1.266 +    except:
   1.267 +        threw = True
   1.268 +
   1.269 +    harness.ok(threw, "Should have thrown.")
   1.270 +
   1.271 +    threw = False
   1.272 +    try:
   1.273 +        parser.parse("""
   1.274 +            interface SpecialMethodSignatureMismatch24 {
   1.275 +              creator boolean foo(unsigned long index, optional boolean value);
   1.276 +            };
   1.277 +        """)
   1.278 +
   1.279 +        results = parser.finish()
   1.280 +    except:
   1.281 +        threw = True
   1.282 +
   1.283 +    harness.ok(threw, "Should have thrown.")
   1.284 +
   1.285 +    threw = False
   1.286 +    try:
   1.287 +        parser.parse("""
   1.288 +            interface SpecialMethodSignatureMismatch25 {
   1.289 +              creator boolean foo();
   1.290 +            };
   1.291 +        """)
   1.292 +
   1.293 +        results = parser.finish()
   1.294 +    except:
   1.295 +        threw = True
   1.296 +
   1.297 +    harness.ok(threw, "Should have thrown.")

mercurial