mojo/public/tools/mojom/mojom/parse/parser_unittest.py
def testInvalidAssociatedKinds(self):
    """Tests that invalid associated interfaces and requests are correctly
    detected."""
    source1 = """\
        struct MyStruct {
          associated associated SomeInterface a;
        };
        """
    with self.assertRaisesRegexp(
        parser.ParseError,
        r"^my_file\.mojom:2: Error: Unexpected 'associated':\n"
        r" *associated associated SomeInterface a;$"):
      parser.Parse(source1, "my_file.mojom")

    source2 = """\
        struct MyStruct {
          associated handle a;
        };
        """
    with self.assertRaisesRegexp(
        parser.ParseError, r"^my_file\.mojom:2: Error: Unexpected 'handle':\n"
        r" *associated handle a;$"):
      parser.Parse(source2, "my_file.mojom")

    source3 = """\
        struct MyStruct {
          associated? MyInterface& a;
        };
        """
    with self.assertRaisesRegexp(
        parser.ParseError, r"^my_file\.mojom:2: Error: Unexpected '\?':\n"
        r" *associated\? MyInterface& a;$"):
      parser.Parse(source3, "my_file.mojom")
Tests that invalid associated interfaces and requests are correctly
    detected.
Tests that invalid associated interfaces and requests are correctly
detected.
Tests that invalid associated interfaces and requests are correctly detected .
def testInvalidAssociatedKinds(self):
    source1 = """\
        struct MyStruct {
          associated associated SomeInterface a;
        };
        """
    with self.assertRaisesRegexp(
        parser.ParseError,
        r"^my_file\.mojom:2: Error: Unexpected 'associated':\n"
        r" *associated associated SomeInterface a;$"):
      parser.Parse(source1, "my_file.mojom")
    source2 = """\
        struct MyStruct {
          associated handle a;
        };
        """
    with self.assertRaisesRegexp(
        parser.ParseError, r"^my_file\.mojom:2: Error: Unexpected 'handle':\n"
        r" *associated handle a;$"):
      parser.Parse(source2, "my_file.mojom")
    source3 = """\
        struct MyStruct {
          associated? MyInterface& a;
        };
        """
    with self.assertRaisesRegexp(
        parser.ParseError, r"^my_file\.mojom:2: Error: Unexpected '\?':\n"
        r" *associated\? MyInterface& a;$"):
      parser.Parse(source3, "my_file.mojom")
def testInvalidAssociatedKinds ( self ) : source1 = """\
        struct MyStruct {
          associated associated SomeInterface a;
        };
        """ with self . assertRaisesRegexp ( parser . ParseError , r"^my_file\.mojom:2: Error: Unexpected 'associated':\n" r" *associated associated SomeInterface a;$" ) : parser . Parse ( source1 , "my_file.mojom" ) source2 = """\
        struct MyStruct {
          associated handle a;
        };
        """ with self . assertRaisesRegexp ( parser . ParseError , r"^my_file\.mojom:2: Error: Unexpected 'handle':\n" r" *associated handle a;$" ) : parser . Parse ( source2 , "my_file.mojom" ) source3 = """\
        struct MyStruct {
          associated? MyInterface& a;
        };
        """ with self . assertRaisesRegexp ( parser . ParseError , r"^my_file\.mojom:2: Error: Unexpected '\?':\n" r" *associated\? MyInterface& a;$" ) : parser . Parse ( source3 , "my_file.mojom" )
Tests that invalid associated interfaces and requests are correctly
detected.
Tests that invalid associated interfaces and requests are correctly detected .
"""Tests that invalid associated interfaces and requests are correctly
    detected."""
self