mojo/public/tools/mojom/mojom/parse/parser_unittest.py
def testValidFixedSizeArray(self):
    """Tests parsing a fixed size array."""

    source = """\
        struct MyStruct {
          array<int32> normal_array;
          array<int32, 1> fixed_size_array_one_entry;
          array<int32, 10> fixed_size_array_ten_entries;
          array<array<array<int32, 1>>, 2> nested_arrays;
        };
        """
    expected = ast.Mojom(None, ast.ImportList(), [
        ast.Struct(
            'MyStruct', None,
            ast.StructBody([
                ast.StructField('normal_array', None, None, 'int32[]', None),
                ast.StructField('fixed_size_array_one_entry', None, None,
                                'int32[1]', None),
                ast.StructField('fixed_size_array_ten_entries', None, None,
                                'int32[10]', None),
                ast.StructField('nested_arrays', None, None, 'int32[1][][2]',
                                None)
            ]))
    ])
    self.assertEquals(parser.Parse(source, "my_file.mojom"), expected)
Tests parsing a fixed size array.
Tests parsing a fixed size array.
Tests parsing a fixed size array .
def testValidFixedSizeArray(self):
    source = """\
        struct MyStruct {
          array<int32> normal_array;
          array<int32, 1> fixed_size_array_one_entry;
          array<int32, 10> fixed_size_array_ten_entries;
          array<array<array<int32, 1>>, 2> nested_arrays;
        };
        """
    expected = ast.Mojom(None, ast.ImportList(), [
        ast.Struct(
            'MyStruct', None,
            ast.StructBody([
                ast.StructField('normal_array', None, None, 'int32[]', None),
                ast.StructField('fixed_size_array_one_entry', None, None,
                                'int32[1]', None),
                ast.StructField('fixed_size_array_ten_entries', None, None,
                                'int32[10]', None),
                ast.StructField('nested_arrays', None, None, 'int32[1][][2]',
                                None)
            ]))
    ])
    self.assertEquals(parser.Parse(source, "my_file.mojom"), expected)
def testValidFixedSizeArray ( self ) : source = """\
        struct MyStruct {
          array<int32> normal_array;
          array<int32, 1> fixed_size_array_one_entry;
          array<int32, 10> fixed_size_array_ten_entries;
          array<array<array<int32, 1>>, 2> nested_arrays;
        };
        """ expected = ast . Mojom ( None , ast . ImportList ( ) , [ ast . Struct ( 'MyStruct' , None , ast . StructBody ( [ ast . StructField ( 'normal_array' , None , None , 'int32[]' , None ) , ast . StructField ( 'fixed_size_array_one_entry' , None , None , 'int32[1]' , None ) , ast . StructField ( 'fixed_size_array_ten_entries' , None , None , 'int32[10]' , None ) , ast . StructField ( 'nested_arrays' , None , None , 'int32[1][][2]' , None ) ] ) ) ] ) self . assertEquals ( parser . Parse ( source , "my_file.mojom" ) , expected )
Tests parsing a fixed size array.
Tests parsing a fixed size array .
"""Tests parsing a fixed size array."""
self