mojo/public/tools/mojom/stable_attribute_unittest.py
def testStableStruct(self):
    """A [Stable] struct is valid if all its fields are also stable."""
    self.ExtractTypes('[Stable] struct S {};')
    self.ExtractTypes('[Stable] struct S { int32 x; bool b; };')
    self.ExtractTypes('[Stable] enum E { A }; [Stable] struct S { E e; };')
    self.ExtractTypes('[Stable] struct S {}; [Stable] struct T { S s; };')
    self.ExtractTypes(
        '[Stable] struct S {}; [Stable] struct T { array<S> ss; };')
    self.ExtractTypes(
        '[Stable] interface F {}; [Stable] struct T { pending_remote<F> f; };')

    with self.assertRaisesRegexp(Exception, 'because it depends on E'):
      self.ExtractTypes('enum E { A }; [Stable] struct S { E e; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on X'):
      self.ExtractTypes('struct X {}; [Stable] struct S { X x; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on T'):
      self.ExtractTypes('struct T {}; [Stable] struct S { array<T> xs; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on T'):
      self.ExtractTypes('struct T {}; [Stable] struct S { map<int32, T> xs; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on T'):
      self.ExtractTypes('struct T {}; [Stable] struct S { map<T, int32> xs; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on F'):
      self.ExtractTypes(
          'interface F {}; [Stable] struct S { pending_remote<F> f; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on F'):
      self.ExtractTypes(
          'interface F {}; [Stable] struct S { pending_receiver<F> f; };')
A [Stable] struct is valid if all its fields are also stable.
A [Stable] struct is valid if all its fields are also stable.
A [ Stable ] struct is valid if all its fields are also stable .
def testStableStruct(self):
    self.ExtractTypes('[Stable] struct S {};')
    self.ExtractTypes('[Stable] struct S { int32 x; bool b; };')
    self.ExtractTypes('[Stable] enum E { A }; [Stable] struct S { E e; };')
    self.ExtractTypes('[Stable] struct S {}; [Stable] struct T { S s; };')
    self.ExtractTypes(
        '[Stable] struct S {}; [Stable] struct T { array<S> ss; };')
    self.ExtractTypes(
        '[Stable] interface F {}; [Stable] struct T { pending_remote<F> f; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on E'):
      self.ExtractTypes('enum E { A }; [Stable] struct S { E e; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on X'):
      self.ExtractTypes('struct X {}; [Stable] struct S { X x; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on T'):
      self.ExtractTypes('struct T {}; [Stable] struct S { array<T> xs; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on T'):
      self.ExtractTypes('struct T {}; [Stable] struct S { map<int32, T> xs; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on T'):
      self.ExtractTypes('struct T {}; [Stable] struct S { map<T, int32> xs; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on F'):
      self.ExtractTypes(
          'interface F {}; [Stable] struct S { pending_remote<F> f; };')
    with self.assertRaisesRegexp(Exception, 'because it depends on F'):
      self.ExtractTypes(
          'interface F {}; [Stable] struct S { pending_receiver<F> f; };')
def testStableStruct ( self ) : self . ExtractTypes ( '[Stable] struct S {};' ) self . ExtractTypes ( '[Stable] struct S { int32 x; bool b; };' ) self . ExtractTypes ( '[Stable] enum E { A }; [Stable] struct S { E e; };' ) self . ExtractTypes ( '[Stable] struct S {}; [Stable] struct T { S s; };' ) self . ExtractTypes ( '[Stable] struct S {}; [Stable] struct T { array<S> ss; };' ) self . ExtractTypes ( '[Stable] interface F {}; [Stable] struct T { pending_remote<F> f; };' ) with self . assertRaisesRegexp ( Exception , 'because it depends on E' ) : self . ExtractTypes ( 'enum E { A }; [Stable] struct S { E e; };' ) with self . assertRaisesRegexp ( Exception , 'because it depends on X' ) : self . ExtractTypes ( 'struct X {}; [Stable] struct S { X x; };' ) with self . assertRaisesRegexp ( Exception , 'because it depends on T' ) : self . ExtractTypes ( 'struct T {}; [Stable] struct S { array<T> xs; };' ) with self . assertRaisesRegexp ( Exception , 'because it depends on T' ) : self . ExtractTypes ( 'struct T {}; [Stable] struct S { map<int32, T> xs; };' ) with self . assertRaisesRegexp ( Exception , 'because it depends on T' ) : self . ExtractTypes ( 'struct T {}; [Stable] struct S { map<T, int32> xs; };' ) with self . assertRaisesRegexp ( Exception , 'because it depends on F' ) : self . ExtractTypes ( 'interface F {}; [Stable] struct S { pending_remote<F> f; };' ) with self . assertRaisesRegexp ( Exception , 'because it depends on F' ) : self . ExtractTypes ( 'interface F {}; [Stable] struct S { pending_receiver<F> f; };' )
A [Stable] struct is valid if all its fields are also stable.
A [ Stable ] struct is valid if all its fields are also stable .
"""A [Stable] struct is valid if all its fields are also stable."""
self