mojo/public/tools/mojom/enum_unittest.py
def testExplicitValues(self):
    """Verifies basic parsing of assigned integral values."""
    types = self.ExtractTypes('enum E { kFoo=0, kBar=2, kBaz };')
    self.assertEqual('kFoo', types['E'].fields[0].mojom_name)
    self.assertEqual(0, types['E'].fields[0].numeric_value)
    self.assertEqual('kBar', types['E'].fields[1].mojom_name)
    self.assertEqual(2, types['E'].fields[1].numeric_value)
    self.assertEqual('kBaz', types['E'].fields[2].mojom_name)
    self.assertEqual(3, types['E'].fields[2].numeric_value)
Verifies basic parsing of assigned integral values.
Verifies basic parsing of assigned integral values.
Verifies basic parsing of assigned integral values .
def testExplicitValues(self):
    types = self.ExtractTypes('enum E { kFoo=0, kBar=2, kBaz };')
    self.assertEqual('kFoo', types['E'].fields[0].mojom_name)
    self.assertEqual(0, types['E'].fields[0].numeric_value)
    self.assertEqual('kBar', types['E'].fields[1].mojom_name)
    self.assertEqual(2, types['E'].fields[1].numeric_value)
    self.assertEqual('kBaz', types['E'].fields[2].mojom_name)
    self.assertEqual(3, types['E'].fields[2].numeric_value)
def testExplicitValues ( self ) : types = self . ExtractTypes ( 'enum E { kFoo=0, kBar=2, kBaz };' ) self . assertEqual ( 'kFoo' , types [ 'E' ] . fields [ 0 ] . mojom_name ) self . assertEqual ( 0 , types [ 'E' ] . fields [ 0 ] . numeric_value ) self . assertEqual ( 'kBar' , types [ 'E' ] . fields [ 1 ] . mojom_name ) self . assertEqual ( 2 , types [ 'E' ] . fields [ 1 ] . numeric_value ) self . assertEqual ( 'kBaz' , types [ 'E' ] . fields [ 2 ] . mojom_name ) self . assertEqual ( 3 , types [ 'E' ] . fields [ 2 ] . numeric_value )
Verifies basic parsing of assigned integral values.
Verifies basic parsing of assigned integral values .
"""Verifies basic parsing of assigned integral values."""
self