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

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

Issue 695583002: Update mojo sdk to rev e083961bf11fd0c94d40be8853761da529b6d444 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch in https://codereview.chromium.org/692823003 Created 6 years, 2 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
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 b27217a314198f1fa04e6385228810da7c0a1bff..cc71f04c9a80beb1080b638669f10df036e9374c 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
@@ -961,7 +961,7 @@ class ParserTest(unittest.TestCase):
"""Tests parsing import statements."""
# One import (no module statement).
- source1 = "import \"somedir/my.mojom\""
+ source1 = "import \"somedir/my.mojom\";"
expected1 = ast.Mojom(
None,
ast.ImportList(ast.Import("somedir/my.mojom")),
@@ -970,8 +970,8 @@ class ParserTest(unittest.TestCase):
# Two imports (no module statement).
source2 = """\
- import "somedir/my1.mojom"
- import "somedir/my2.mojom"
+ import "somedir/my1.mojom";
+ import "somedir/my2.mojom";
"""
expected2 = ast.Mojom(
None,
@@ -982,8 +982,8 @@ class ParserTest(unittest.TestCase):
# Imports with module statement.
source3 = """\
- import "somedir/my1.mojom"
- import "somedir/my2.mojom"
+ import "somedir/my1.mojom";
+ import "somedir/my2.mojom";
module my_module {}
"""
expected3 = ast.Mojom(
@@ -1016,6 +1016,16 @@ class ParserTest(unittest.TestCase):
r" *module {}$"):
parser.Parse(source2, "my_file.mojom")
+ source3 = """\
+ import "foo.mojom" // Missing semicolon.
+ module {}
+ """
+ with self.assertRaisesRegexp(
+ parser.ParseError,
+ r"^my_file\.mojom:2: Error: Unexpected 'module':\n"
+ r" *module {}$"):
+ parser.Parse(source3, "my_file.mojom")
+
def testValidNullableTypes(self):
"""Tests parsing nullable types."""
« no previous file with comments | « mojo/public/tools/bindings/pylib/mojom/parse/parser.py ('k') | mojo/services/public/cpp/native_viewport/args.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698