Files
servo/third_party/WebIDL/tests/test_special_method_signature_mismatch.py
Martin Robinson 8be014ee46 Create a top-level "third_party" directory
This directory now contains third_party software that is vendored into
the Servo source tree. The idea is that it would eventually hold
webrender and other crates from mozilla-central as well with a standard
patch management approach for each.
2023-06-30 09:51:31 +02:00

257 lines
5.2 KiB
Python

def WebIDLTest(parser, harness):
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch1 {
getter long long foo(long index);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch2 {
getter undefined foo(unsigned long index);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch3 {
getter boolean foo(unsigned long index, boolean extraArg);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch4 {
getter boolean foo(unsigned long... index);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch5 {
getter boolean foo(optional unsigned long index);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch6 {
getter boolean foo();
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch7 {
deleter long long foo(long index);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch9 {
deleter boolean foo(unsigned long index, boolean extraArg);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch10 {
deleter boolean foo(unsigned long... index);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch11 {
deleter boolean foo(optional unsigned long index);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch12 {
deleter boolean foo();
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch13 {
setter long long foo(long index, long long value);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch15 {
setter boolean foo(unsigned long index, boolean value, long long extraArg);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch16 {
setter boolean foo(unsigned long index, boolean... value);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch17 {
setter boolean foo(unsigned long index, optional boolean value);
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface SpecialMethodSignatureMismatch18 {
setter boolean foo();
};
"""
)
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have thrown.")