Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(992)

Unified Diff: mojo/public/bindings/pylib/parse/mojo_parser_unittest.py

Issue 213693004: Mojo: Mojom: Remove relational (e.g., !=) and logical operators (e.g., || and !). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/bindings/pylib/parse/mojo_parser.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/bindings/pylib/parse/mojo_parser_unittest.py
diff --git a/mojo/public/bindings/pylib/parse/mojo_parser_unittest.py b/mojo/public/bindings/pylib/parse/mojo_parser_unittest.py
index 88a17c8106a40aa1d357575e89d6850acea8079e..d9f13d10dde10a9e1c3544a3494e1533b775d8b6 100644
--- a/mojo/public/bindings/pylib/parse/mojo_parser_unittest.py
+++ b/mojo/public/bindings/pylib/parse/mojo_parser_unittest.py
@@ -72,11 +72,18 @@ enum MyEnum {
MY_ENUM_2 = 1 + 1,
MY_ENUM_3 = 1 * 3,
MY_ENUM_4 = 2 * (1 + 1),
- MY_ENUM_5 = 1 + 2 * 2
+ MY_ENUM_5 = 1 + 2 * 2,
+ MY_ENUM_6 = -6 / -2,
+ MY_ENUM_7 = 3 | (1 << 2),
+ MY_ENUM_8 = 16 >> 1,
+ MY_ENUM_9 = 1 ^ 15 & 8,
+ MY_ENUM_10 = 110 % 100,
+ MY_ENUM_MINUS_1 = ~0
};
} // my_module
"""
+ self.maxDiff = 2000
expected = \
[('MODULE',
'my_module',
@@ -91,7 +98,23 @@ enum MyEnum {
['2', '*', '(', ('EXPRESSION', ['1', '+', '1']), ')'])),
('ENUM_FIELD',
'MY_ENUM_5',
- ('EXPRESSION', ['1', '+', '2', '*', '2']))])])]
+ ('EXPRESSION', ['1', '+', '2', '*', '2'])),
+ ('ENUM_FIELD',
+ 'MY_ENUM_6',
+ ('EXPRESSION',
+ ['-', ('EXPRESSION', ['6', '/', '-', ('EXPRESSION', ['2'])])])),
+ ('ENUM_FIELD',
+ 'MY_ENUM_7',
+ ('EXPRESSION',
+ ['3', '|', '(', ('EXPRESSION', ['1', '<<', '2']), ')'])),
+ ('ENUM_FIELD', 'MY_ENUM_8', ('EXPRESSION', ['16', '>>', '1'])),
+ ('ENUM_FIELD',
+ 'MY_ENUM_9',
+ ('EXPRESSION', ['1', '^', '15', '&', '8'])),
+ ('ENUM_FIELD', 'MY_ENUM_10', ('EXPRESSION', ['110', '%', '100'])),
+ ('ENUM_FIELD',
+ 'MY_ENUM_MINUS_1',
+ ('EXPRESSION', ['~', ('EXPRESSION', ['0'])]))])])]
self.assertEquals(mojo_parser.Parse(source, "my_file.mojom"), expected)
def testNoConditionals(self):
« no previous file with comments | « mojo/public/bindings/pylib/parse/mojo_parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698