servo/third_party/WebIDL/tests/test_duplicate_qualifiers.py
Ngo Iok Ui (Wu Yu Wei) 8eed3b442b
Update WebIDL.py (#32495)
* Update WebIDL.py

* Update WebIDL.py

* Add builtin-array.patch

* Fix CodegenRust.py and Configuration.py

* Fix missing downcasts

* mach fmt

* Update check and comment to explain why we need this check

* Update Global of DissimilarOriginWindow.webidl
2024-06-15 04:22:42 +00:00

67 lines
1.4 KiB
Python

import WebIDL
def WebIDLTest(parser, harness):
threw = False
try:
parser.parse(
"""
interface DuplicateQualifiers1 {
getter getter byte foo(unsigned long index);
};
"""
)
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface DuplicateQualifiers2 {
setter setter byte foo(unsigned long index, byte value);
};
"""
)
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface DuplicateQualifiers4 {
deleter deleter byte foo(unsigned long index);
};
"""
)
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(threw, "Should have thrown.")
threw = False
try:
parser.parse(
"""
interface DuplicateQualifiers5 {
getter deleter getter byte foo(unsigned long index);
};
"""
)
parser.finish()
except WebIDL.WebIDLError:
threw = True
harness.ok(threw, "Should have thrown.")