Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Unified Diff: tools/json_schema_compiler/model_test.py

Issue 273323002: Convert snakecase enum names to camelcase when stringified. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final changes Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/json_schema_compiler/model.py ('k') | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/model_test.py
diff --git a/tools/json_schema_compiler/model_test.py b/tools/json_schema_compiler/model_test.py
index 0e398a5a5bb2b969d81d4967d5bd2b09c0c042cc..75ed9c5817f0b208395970deea47d3405782fcc0 100755
--- a/tools/json_schema_compiler/model_test.py
+++ b/tools/json_schema_compiler/model_test.py
@@ -118,6 +118,21 @@ class ModelTest(unittest.TestCase):
for name in expectations:
self.assertEquals(expectations[name], model.UnixName(name))
+ def testCamelName(self):
+ expectations = {
+ 'foo': 'foo',
+ 'fooBar': 'fooBar',
+ 'foo_bar_baz': 'fooBarBaz',
+ 'FOO_BAR': 'FOOBar',
+ 'FOO_bar': 'FOOBar',
+ '_bar': 'Bar',
+ '_bar_baz': 'BarBaz',
+ 'bar_': 'bar',
+ 'bar_baz_': 'barBaz',
+ }
+ for testcase, expected in expectations.iteritems():
+ self.assertEquals(expected, model.CamelName(testcase))
+
def testPlatforms(self):
self.assertEqual([Platforms.CHROMEOS],
self.idl_namespace_chromeos.platforms)
« no previous file with comments | « tools/json_schema_compiler/model.py ('k') | ui/accessibility/ax_enums.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698