Example #1
0
 def testToSnakeCase(self):
     self.assertEquals("snake_case",
                       generator.ToLowerSnakeCase("SnakeCase"))
     self.assertEquals("snake_case",
                       generator.ToLowerSnakeCase("snakeCase"))
     self.assertEquals("snake_case",
                       generator.ToLowerSnakeCase("SnakeCASE"))
     self.assertEquals("snake_d3d11_case",
                       generator.ToLowerSnakeCase("SnakeD3D11Case"))
     self.assertEquals("snake_d3d11_case",
                       generator.ToLowerSnakeCase("SnakeD3d11Case"))
     self.assertEquals("snake_d3d11_case",
                       generator.ToLowerSnakeCase("snakeD3d11Case"))
     self.assertEquals("SNAKE_CASE",
                       generator.ToUpperSnakeCase("SnakeCase"))
     self.assertEquals("SNAKE_CASE",
                       generator.ToUpperSnakeCase("snakeCase"))
     self.assertEquals("SNAKE_CASE",
                       generator.ToUpperSnakeCase("SnakeCASE"))
     self.assertEquals("SNAKE_D3D11_CASE",
                       generator.ToUpperSnakeCase("SnakeD3D11Case"))
     self.assertEquals("SNAKE_D3D11_CASE",
                       generator.ToUpperSnakeCase("SnakeD3d11Case"))
     self.assertEquals("SNAKE_D3D11_CASE",
                       generator.ToUpperSnakeCase("snakeD3d11Case"))
Example #2
0
 def StylizeConstant(self, mojom_name):
     return generator.ToUpperSnakeCase(mojom_name)
Example #3
0
def ConstantStyle(name):
    return generator.ToUpperSnakeCase(name)