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

Unified Diff: mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py

Issue 363033004: Mojo: bindings generator: Add an AST type for parameter lists. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 years, 6 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/tools/bindings/pylib/mojom/parse/translate.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py
diff --git a/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py b/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py
index 71ab32b62e66a35ec123fff96892b22f8b584704..422cb165ca37bcdb9745dab2fb27edc52179cc50 100644
--- a/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py
+++ b/mojo/public/tools/bindings/pylib/mojom_tests/parse/parser_unittest.py
@@ -592,7 +592,7 @@ class ParserTest(unittest.TestCase):
None,
[('METHOD',
'MyMethod',
- [ast.Parameter('int32', 'a', ast.Ordinal(None))],
+ ast.ParameterList(ast.Parameter('int32', 'a', ast.Ordinal(None))),
ast.Ordinal(None),
None)])])]
self.assertEquals(parser.Parse(source1, "my_file.mojom"), expected1)
@@ -612,15 +612,15 @@ class ParserTest(unittest.TestCase):
None,
[('METHOD',
'MyMethod1',
- [ast.Parameter('int32', 'a', ast.Ordinal(0)),
- ast.Parameter('int64', 'b', ast.Ordinal(1))],
+ ast.ParameterList([ast.Parameter('int32', 'a', ast.Ordinal(0)),
+ ast.Parameter('int64', 'b', ast.Ordinal(1))]),
ast.Ordinal(0),
None),
('METHOD',
'MyMethod2',
- [],
+ ast.ParameterList(),
ast.Ordinal(1),
- [])])])]
+ ast.ParameterList())])])]
self.assertEquals(parser.Parse(source2, "my_file.mojom"), expected2)
source3 = """\
@@ -637,10 +637,12 @@ class ParserTest(unittest.TestCase):
None,
[('METHOD',
'MyMethod',
- [ast.Parameter('string', 'a', ast.Ordinal(None))],
+ ast.ParameterList(ast.Parameter('string', 'a',
+ ast.Ordinal(None))),
ast.Ordinal(None),
- [ast.Parameter('int32', 'a', ast.Ordinal(None)),
- ast.Parameter('bool', 'b', ast.Ordinal(None))])])])]
+ ast.ParameterList([ast.Parameter('int32', 'a', ast.Ordinal(None)),
+ ast.Parameter('bool', 'b',
+ ast.Ordinal(None))]))])])]
self.assertEquals(parser.Parse(source3, "my_file.mojom"), expected3)
def testInvalidMethods(self):
« no previous file with comments | « mojo/public/tools/bindings/pylib/mojom/parse/translate.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698