mojo/public/tools/mojom/mojom/parse/parser_unittest.py
def testSimpleStructWithoutModule(self):
    """Tests a simple struct without an explict module statement."""

    source = """\
        struct MyStruct {
          int32 a;
          double b;
        };
        """
    expected = ast.Mojom(None, ast.ImportList(), [
        ast.Struct(
            'MyStruct', None,
            ast.StructBody([
                ast.StructField('a', None, None, 'int32', None),
                ast.StructField('b', None, None, 'double', None)
            ]))
    ])
    self.assertEquals(parser.Parse(source, "my_file.mojom"), expected)
Tests a simple struct without an explict module statement.
Tests a simple struct without an explict module statement.
Tests a simple struct without an explict module statement .
def testSimpleStructWithoutModule(self):
    source = """\
        struct MyStruct {
          int32 a;
          double b;
        };
        """
    expected = ast.Mojom(None, ast.ImportList(), [
        ast.Struct(
            'MyStruct', None,
            ast.StructBody([
                ast.StructField('a', None, None, 'int32', None),
                ast.StructField('b', None, None, 'double', None)
            ]))
    ])
    self.assertEquals(parser.Parse(source, "my_file.mojom"), expected)
def testSimpleStructWithoutModule ( self ) : source = """\
        struct MyStruct {
          int32 a;
          double b;
        };
        """ expected = ast . Mojom ( None , ast . ImportList ( ) , [ ast . Struct ( 'MyStruct' , None , ast . StructBody ( [ ast . StructField ( 'a' , None , None , 'int32' , None ) , ast . StructField ( 'b' , None , None , 'double' , None ) ] ) ) ] ) self . assertEquals ( parser . Parse ( source , "my_file.mojom" ) , expected )
Tests a simple struct without an explict module statement.
Tests a simple struct without an explict module statement .
"""Tests a simple struct without an explict module statement."""
self