Chromium Code Reviews| Index: build/android/gyp/java_cpp_enum_tests.py |
| diff --git a/build/android/gyp/java_cpp_enum_tests.py b/build/android/gyp/java_cpp_enum_tests.py |
| index 3444cfa254affb6369f18017e5b56d379cecc020..e80bb60d319cdf36089d6a315ed14ea3b062f2b2 100755 |
| --- a/build/android/gyp/java_cpp_enum_tests.py |
| +++ b/build/android/gyp/java_cpp_enum_tests.py |
| @@ -26,7 +26,13 @@ class TestPreprocess(unittest.TestCase): |
| def testOutput(self): |
| definition = EnumDefinition(original_enum_name='ClassName', |
| enum_package='some.package', |
| - entries=[('E1', 1), ('E2', '2 << 2')]) |
| + entries=[('E1', 1), ('E2', '2 << 2')], |
| + comments=[('E2', 'This is a comment.'), |
| + ('E1', 'This is a multiple line ' |
| + 'comment that is really long. ' |
| + 'This is a multiple line ' |
| + 'comment that is really ' |
| + 'really long.')]) |
| output = GenerateOutput('path/to/file', definition) |
| expected = """ |
| // Copyright %d The Chromium Authors. All rights reserved. |
| @@ -51,7 +57,14 @@ public class ClassName { |
| }) |
| @Retention(RetentionPolicy.SOURCE) |
| public @interface ClassNameEnum {} |
| + /** |
| + * This is a multiple line comment that is really long. This is a multiple line comment that is |
|
xunjieli
2016/08/04 14:19:31
Is there a way to bypass the "Found lines longer t
agrieve
2016/08/04 16:39:39
Another option would be to use %s%s or str.format(
xunjieli
2016/08/04 19:34:02
Done. I couldn't get pylint:disable to work for th
|
| + * really really long. |
| + */ |
| public static final int E1 = 1; |
| + /** |
| + * This is a comment. |
| + */ |
| public static final int E2 = 2 << 2; |
| } |
| """ |
| @@ -134,6 +147,8 @@ public class ClassName { |
| // GENERATED_JAVA_PREFIX_TO_STRIP: P_ |
| enum EnumTwo { |
| P_A, |
| + // This comment spans |
| + // two lines. |
| P_B |
| }; |
| """.split('\n') |
| @@ -145,10 +160,13 @@ public class ClassName { |
| self.assertEqual(collections.OrderedDict([('A', '1'), |
| ('B', 'A')]), |
| definition.entries) |
| - |
| + self.assertEqual(collections.OrderedDict([('ENUM_ONE_B', 'Comment there')]), |
| + definition.comments) |
| definition = definitions[1] |
| self.assertEqual('EnumTwo', definition.class_name) |
| self.assertEqual('other.package', definition.enum_package) |
| + self.assertEqual(collections.OrderedDict( |
| + [('P_B', 'This comment spans two lines.')]), definition.comments) |
| self.assertEqual(collections.OrderedDict([('A', 0), |
| ('B', 1)]), |
| definition.entries) |