mojo/public/tools/mojom/mojom/parse/parser_unittest.py
def testUnionWithMapMember(self):
    """Test that map members are accepted."""
    source = """\
        module my_module;

        union MyUnion {
          map<int32, string> m;
        };
        """
    expected = ast.Mojom(
        ast.Module(('IDENTIFIER', 'my_module'), None), ast.ImportList(), [
            ast.Union(
                'MyUnion', None,
                ast.UnionBody(
                    [ast.UnionField('m', None, None, 'string{int32}')]))
        ])
    actual = parser.Parse(source, "my_file.mojom")
    self.assertEquals(actual, expected)
Test that map members are accepted.
Test that map members are accepted.
Test that map members are accepted .
def testUnionWithMapMember(self):
    source = """\
        module my_module;
        union MyUnion {
          map<int32, string> m;
        };
        """
    expected = ast.Mojom(
        ast.Module(('IDENTIFIER', 'my_module'), None), ast.ImportList(), [
            ast.Union(
                'MyUnion', None,
                ast.UnionBody(
                    [ast.UnionField('m', None, None, 'string{int32}')]))
        ])
    actual = parser.Parse(source, "my_file.mojom")
    self.assertEquals(actual, expected)
def testUnionWithMapMember ( self ) : source = """\
        module my_module;

        union MyUnion {
          map<int32, string> m;
        };
        """ expected = ast . Mojom ( ast . Module ( ( 'IDENTIFIER' , 'my_module' ) , None ) , ast . ImportList ( ) , [ ast . Union ( 'MyUnion' , None , ast . UnionBody ( [ ast . UnionField ( 'm' , None , None , 'string{int32}' ) ] ) ) ] ) actual = parser . Parse ( source , "my_file.mojom" ) self . assertEquals ( actual , expected )
Test that map members are accepted.
Test that map members are accepted .
"""Test that map members are accepted."""
self