mojo/public/tools/mojom/mojom/parse/parser_unittest.py
def testSimpleStruct(self):
    """Tests a simple .mojom source that just defines a struct."""

    source = """\
        module my_module;

        struct MyStruct {
          int32 a;
          double b;
        };
        """
    expected = ast.Mojom(
        ast.Module(('IDENTIFIER', 'my_module'), 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 .mojom source that just defines a struct.
Tests a simple .mojom source that just defines a struct.
Tests a simple . mojom source that just defines a struct .
def testSimpleStruct(self):
    source = """\
        module my_module;
        struct MyStruct {
          int32 a;
          double b;
        };
        """
    expected = ast.Mojom(
        ast.Module(('IDENTIFIER', 'my_module'), 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 testSimpleStruct ( self ) : source = """\
        module my_module;

        struct MyStruct {
          int32 a;
          double b;
        };
        """ expected = ast . Mojom ( ast . Module ( ( 'IDENTIFIER' , 'my_module' ) , 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 .mojom source that just defines a struct.
Tests a simple . mojom source that just defines a struct .
"""Tests a simple .mojom source that just defines a struct."""
self