Repository: jhump/protoreflect
Pull request #546 (2023-01-24 00:55:06)

another fuzz test fix, even newer version of protocompile


Patch:
diff --git a/go.mod b/go.mod
index 17eee28..400bb8e 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/jhump/protoreflect
 go 1.18
 
 require (
-	github.com/bufbuild/protocompile v0.2.1-0.20230119135714-40851cffb6f2
+	github.com/bufbuild/protocompile v0.2.1-0.20230123224550-da57cd758c2f
 	github.com/golang/protobuf v1.5.0
 	github.com/jhump/gopoet v0.1.0
 	github.com/jhump/goprotoc v0.5.0
diff --git a/go.sum b/go.sum
index 8659a66..7c3c243 100644
--- a/go.sum
+++ b/go.sum
@@ -1,7 +1,7 @@
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/bufbuild/protocompile v0.2.1-0.20230119135714-40851cffb6f2 h1:L3kz7LEs8OMSz/TuFVb7q5JGE9KlYACmhp2ZECm0U1M=
-github.com/bufbuild/protocompile v0.2.1-0.20230119135714-40851cffb6f2/go.mod h1:tleDrpPTlLUVmgnEoN6qBliKWqJaZFJXqZdFjTd+ocU=
+github.com/bufbuild/protocompile v0.2.1-0.20230123224550-da57cd758c2f h1:IXSA5gow10s7zIOJfPOpXDtNBWCTA0715BDAhoJBXEs=
+github.com/bufbuild/protocompile v0.2.1-0.20230123224550-da57cd758c2f/go.mod h1:tleDrpPTlLUVmgnEoN6qBliKWqJaZFJXqZdFjTd+ocU=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
 github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=


Test patch:
diff --git a/desc/protoparse/linker_test.go b/desc/protoparse/linker_test.go
index 493e330..27a86ae 100644
--- a/desc/protoparse/linker_test.go
+++ b/desc/protoparse/linker_test.go
@@ -1047,7 +1047,7 @@ func TestLinkerValidation(t *testing.T) {
 					"  string bar = 2 [json_name=\"Foo_Bar\"];\n" +
 					"}\n",
 			},
-			"foo.proto:4:3: field Foo.bar: custom JSON name \"Foo_Bar\" conflicts with custom JSON name \"foo_bar\" of field foo, defined at foo.proto:3:3",
+			"", // should succeed
 		},
 		{
 			map[string]string{
@@ -1076,7 +1076,7 @@ func TestLinkerValidation(t *testing.T) {
 					"  string FOO_BAR = 2;\n" +
 					"}\n",
 			},
-			"foo.proto:4:3: field Foo.FOO_BAR: default JSON name \"FOOBAR\" conflicts with default JSON name \"fooBar\" of field fooBar, defined at foo.proto:3:3",
+			"", // should succeed
 		},
 		{
 			map[string]string{
@@ -1086,7 +1086,7 @@ func TestLinkerValidation(t *testing.T) {
 					"  string __foo_bar = 2;\n" +
 					"}\n",
 			},
-			"foo.proto:4:3: field Foo.__foo_bar: default JSON name \"FooBar\" conflicts with default JSON name \"fooBar\" of field fooBar, defined at foo.proto:3:3",
+			"", // should succeed
 		},
 		{
 			map[string]string{
@@ -1096,7 +1096,7 @@ func TestLinkerValidation(t *testing.T) {
 					"  optional string bar = 2 [json_name=\"Foo_Bar\"];\n" +
 					"}\n",
 			},
-			"foo.proto:4:3: field Foo.bar: custom JSON name \"Foo_Bar\" conflicts with custom JSON name \"foo_bar\" of field foo, defined at foo.proto:3:3",
+			"", // should succeed
 		},
 		{
 			map[string]string{
@@ -1108,7 +1108,7 @@ func TestLinkerValidation(t *testing.T) {
 					"  }\n" +
 					"}\n",
 			},
-			"foo.proto:5:5: field Foo.bar: custom JSON name \"Foo_Bar\" conflicts with custom JSON name \"foo_bar\" of field foo, defined at foo.proto:4:5",
+			"", // should succeed
 		},
 		{
 			map[string]string{
@@ -1393,14 +1393,6 @@ func TestCustomJSONNameWarnings(t *testing.T) {
 		source  string
 		warning string
 	}{
-		{
-			source: "syntax = \"proto2\";\n" +
-				"message Foo {\n" +
-				"  optional string foo = 1;\n" +
-				"  optional string bar = 2 [json_name=\"foo\"];\n" +
-				"}\n",
-			warning: "test.proto:4:3: field Foo.bar: custom JSON name \"foo\" conflicts with default JSON name of field foo, defined at test.proto:3:3",
-		},
 		{
 			source: "syntax = \"proto2\";\n" +
 				"message Foo {\n" +
@@ -1418,14 +1410,6 @@ func TestCustomJSONNameWarnings(t *testing.T) {
 			warning: "test.proto:4:3: field Foo.fooBar: default JSON name \"fooBar\" conflicts with default JSON name of field foo_bar, defined at test.proto:3:3",
 		},
 		// in nested message
-		{
-			source: "syntax = \"proto2\";\n" +
-				"message Blah { message Foo {\n" +
-				"  optional string foo = 1;\n" +
-				"  optional string bar = 2 [json_name=\"foo\"];\n" +
-				"} }\n",
-			warning: "test.proto:4:3: field Foo.bar: custom JSON name \"foo\" conflicts with default JSON name of field foo, defined at test.proto:3:3",
-		},
 		{
 			source: "syntax = \"proto2\";\n" +
 				"message Blah { message Foo {\n" +