| Index: third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc
|
| diff --git a/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc
|
| index 7ef7df42b6b209b9d50a9f3475b610929710f8f7..5755fee00b174ea8749389df5b6a1c06a6b17a8e 100644
|
| --- a/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc
|
| +++ b/third_party/protobuf/src/google/protobuf/compiler/csharp/csharp_generator_unittest.cc
|
| @@ -30,8 +30,8 @@
|
|
|
| #include <memory>
|
|
|
| -#include <google/protobuf/compiler/ruby/ruby_generator.h>
|
| #include <google/protobuf/compiler/command_line_interface.h>
|
| +#include <google/protobuf/compiler/csharp/csharp_helpers.h>
|
| #include <google/protobuf/io/zero_copy_stream.h>
|
| #include <google/protobuf/io/printer.h>
|
|
|
| @@ -45,7 +45,23 @@ namespace compiler {
|
| namespace csharp {
|
| namespace {
|
|
|
| -// TODO(jtattermusch): add some tests.
|
| +TEST(CSharpEnumValue, PascalCasedPrefixStripping) {
|
| + EXPECT_EQ("Bar", GetEnumValueName("Foo", "BAR"));
|
| + EXPECT_EQ("BarBaz", GetEnumValueName("Foo", "BAR_BAZ"));
|
| + EXPECT_EQ("Bar", GetEnumValueName("Foo", "FOO_BAR"));
|
| + EXPECT_EQ("Bar", GetEnumValueName("Foo", "FOO__BAR"));
|
| + EXPECT_EQ("BarBaz", GetEnumValueName("Foo", "FOO_BAR_BAZ"));
|
| + EXPECT_EQ("BarBaz", GetEnumValueName("Foo", "Foo_BarBaz"));
|
| + EXPECT_EQ("Bar", GetEnumValueName("FO_O", "FOO_BAR"));
|
| + EXPECT_EQ("Bar", GetEnumValueName("FOO", "F_O_O_BAR"));
|
| + EXPECT_EQ("Bar", GetEnumValueName("Foo", "BAR"));
|
| + EXPECT_EQ("BarBaz", GetEnumValueName("Foo", "BAR_BAZ"));
|
| + EXPECT_EQ("Foo", GetEnumValueName("Foo", "FOO"));
|
| + EXPECT_EQ("Foo", GetEnumValueName("Foo", "FOO___"));
|
| + // Identifiers can't start with digits
|
| + EXPECT_EQ("_2Bar", GetEnumValueName("Foo", "FOO_2_BAR"));
|
| + EXPECT_EQ("_2", GetEnumValueName("Foo", "FOO___2"));
|
| +}
|
|
|
| } // namespace
|
| } // namespace csharp
|
|
|