diff options
author | Kagami Sascha Rosylight <saschanaz@outlook.com> | 2019-07-11 13:16:10 +0900 |
---|---|---|
committer | Kagami Sascha Rosylight <saschanaz@outlook.com> | 2019-07-12 12:14:06 +0900 |
commit | 56f31c85ef9cc79140f375641302310c6680ded4 (patch) | |
tree | fc0616a5f5d1df4434e9974e5bc62db2389ffcef /components/script/dom/bindings/codegen/parser/tests/test_const.py | |
parent | 5fdc7c0d2c787ef562809072e3dd7c3258dc8a83 (diff) | |
download | servo-56f31c85ef9cc79140f375641302310c6680ded4.tar.gz servo-56f31c85ef9cc79140f375641302310c6680ded4.zip |
Sync WebIDL.py with gecko
Diffstat (limited to 'components/script/dom/bindings/codegen/parser/tests/test_const.py')
-rw-r--r-- | components/script/dom/bindings/codegen/parser/tests/test_const.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/components/script/dom/bindings/codegen/parser/tests/test_const.py b/components/script/dom/bindings/codegen/parser/tests/test_const.py index 80b6fb0e9c8..918f284a226 100644 --- a/components/script/dom/bindings/codegen/parser/tests/test_const.py +++ b/components/script/dom/bindings/codegen/parser/tests/test_const.py @@ -12,9 +12,6 @@ expected = [ ("::TestConsts::ll", "ll", "LongLong", -8), ("::TestConsts::t", "t", "Boolean", True), ("::TestConsts::f", "f", "Boolean", False), - ("::TestConsts::n", "n", "BooleanOrNull", None), - ("::TestConsts::nt", "nt", "BooleanOrNull", True), - ("::TestConsts::nf", "nf", "BooleanOrNull", False), ("::TestConsts::fl", "fl", "Float", 0.2), ("::TestConsts::db", "db", "Double", 0.2), ("::TestConsts::ufl", "ufl", "UnrestrictedFloat", 0.2), @@ -39,9 +36,6 @@ def WebIDLTest(parser, harness): const long long ll = -010; const boolean t = true; const boolean f = false; - const boolean? n = null; - const boolean? nt = true; - const boolean? nf = false; const float fl = 0.2; const double db = 0.2; const unrestricted float ufl = 0.2; @@ -78,3 +72,16 @@ def WebIDLTest(parser, harness): "Const's value has the same type as the type") harness.check(const.value.value, value, "Const value has the right value.") + + parser = parser.reset() + threw = False + try: + parser.parse(""" + interface TestConsts { + const boolean? zero = 0; + }; + """) + parser.finish() + except: + threw = True + harness.ok(threw, "Nullable types are not allowed for consts.") |