diff options
author | Jon Skeet <jonskeet@google.com> | 2016-01-15 12:02:07 +0000 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2016-01-15 12:02:07 +0000 |
commit | f437b67f600545f432863457a39870cb74675d34 (patch) | |
tree | 608f813163899f678c04726117f36a006199b332 /csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs | |
parent | 022a9b267561a3fccfcfaa7023779b969692bf74 (diff) | |
download | protobuf-f437b67f600545f432863457a39870cb74675d34.tar.gz protobuf-f437b67f600545f432863457a39870cb74675d34.tar.bz2 protobuf-f437b67f600545f432863457a39870cb74675d34.zip |
Extra strictness for FieldMask conversion
Diffstat (limited to 'csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs')
-rw-r--r-- | csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs index 09308556..98b00f46 100644 --- a/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs +++ b/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs @@ -418,6 +418,16 @@ namespace Google.Protobuf } [Test] + [TestCase("foo__bar")] + [TestCase("foo_3_ar")] + [TestCase("fooBar")] + public void FieldMaskInvalid(string input) + { + var mask = new FieldMask { Paths = { input } }; + Assert.Throws<InvalidOperationException>(() => JsonFormatter.Default.Format(mask)); + } + + [Test] public void FieldMaskStandalone() { var fieldMask = new FieldMask { Paths = { "", "single", "with_underscore", "nested.field.name", "nested..double_dot" } }; |