-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new tests for EXTENSION_NO_DELETE and PACKAGE_EXTENSION_NO_DELETE…
… rules
- Loading branch information
Showing
18 changed files
with
445 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_extension_no_delete/1.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
syntax = "proto3"; | ||
|
||
package a; | ||
|
||
message Two { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
|
||
message Three { | ||
message Four { | ||
message Five { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
message Six { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
} | ||
message Seven { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
message Eight { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} |
25 changes: 25 additions & 0 deletions
25
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_extension_no_delete/2.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
syntax = "proto2"; | ||
|
||
package a; | ||
|
||
import "3.proto"; | ||
import "4.proto"; | ||
|
||
message One { | ||
optional int32 one = 1; | ||
optional int32 two = 2; | ||
} | ||
|
||
message Nine { | ||
optional int32 one = 1; | ||
optional int32 three = 3; | ||
} | ||
|
||
extend Foo { | ||
optional bytes meta = 20; | ||
optional Foo ch = 22; | ||
} | ||
|
||
extend b.Fizz { | ||
optional b.Fizz child = 22; | ||
} |
20 changes: 20 additions & 0 deletions
20
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_extension_no_delete/3.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syntax = "proto2"; | ||
|
||
package b; | ||
|
||
message Fizz { | ||
extensions 10 to 100; | ||
|
||
message Buzz { | ||
optional int32 len = 1; | ||
|
||
extend Fizz { | ||
optional string str = 10; | ||
} | ||
} | ||
} | ||
|
||
extend Fizz { | ||
optional bytes meta = 20; | ||
repeated uint64 tags = 21; | ||
} |
16 changes: 16 additions & 0 deletions
16
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_extension_no_delete/4.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto2"; | ||
|
||
package a; | ||
|
||
message Foo { | ||
extensions 10 to 100; | ||
|
||
message Bar { | ||
optional int32 len = 1; | ||
|
||
extend Foo { | ||
optional string str = 10; | ||
repeated string labels = 11; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_extension_no_delete/buf.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: v2 | ||
breaking: | ||
use: | ||
- EXTENSION_NO_DELETE |
37 changes: 37 additions & 0 deletions
37
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_package_extension_no_delete/1.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
syntax = "proto3"; | ||
|
||
package a; | ||
|
||
message Two { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
|
||
message Three { | ||
message Four { | ||
message Five { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
message Six { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
} | ||
message Seven { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
message Eight { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} |
25 changes: 25 additions & 0 deletions
25
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_package_extension_no_delete/2.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
syntax = "proto2"; | ||
|
||
package a; | ||
|
||
import "3.proto"; | ||
import "4.proto"; | ||
|
||
message One { | ||
optional int32 one = 1; | ||
optional int32 two = 2; | ||
} | ||
|
||
message Nine { | ||
optional int32 one = 1; | ||
optional int32 three = 3; | ||
} | ||
|
||
extend Foo { | ||
optional bytes meta = 20; | ||
optional Foo ch = 22; | ||
} | ||
|
||
extend b.Fizz { | ||
optional b.Fizz child = 22; | ||
} |
20 changes: 20 additions & 0 deletions
20
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_package_extension_no_delete/3.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
syntax = "proto2"; | ||
|
||
package b; | ||
|
||
message Fizz { | ||
extensions 10 to 100; | ||
|
||
message Buzz { | ||
optional int32 len = 1; | ||
|
||
extend Fizz { | ||
optional string str = 10; | ||
} | ||
} | ||
} | ||
|
||
extend Fizz { | ||
optional bytes meta = 20; | ||
repeated uint64 tags = 21; | ||
} |
16 changes: 16 additions & 0 deletions
16
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_package_extension_no_delete/4.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
syntax = "proto2"; | ||
|
||
package a; | ||
|
||
message Foo { | ||
extensions 10 to 100; | ||
|
||
message Bar { | ||
optional int32 len = 1; | ||
|
||
extend Foo { | ||
optional string str = 10; | ||
repeated string labels = 11; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
private/bufpkg/bufcheck/bufbreaking/testdata/breaking_package_extension_no_delete/buf.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: v2 | ||
breaking: | ||
use: | ||
- PACKAGE_EXTENSION_NO_DELETE |
49 changes: 49 additions & 0 deletions
49
private/bufpkg/bufcheck/bufbreaking/testdata_previous/breaking_extension_no_delete/1.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
syntax = "proto3"; | ||
|
||
package a; | ||
|
||
message One { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
|
||
message Two { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
|
||
message Three { | ||
message Four { | ||
message Five { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
message Six { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
} | ||
message Seven { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
message Eight { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} | ||
|
||
message Nine { | ||
int32 one = 1; | ||
int32 two = 2; | ||
int32 three = 3; | ||
} |
22 changes: 22 additions & 0 deletions
22
private/bufpkg/bufcheck/bufbreaking/testdata_previous/breaking_extension_no_delete/2.proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
syntax = "proto2"; | ||
|
||
package a; | ||
|
||
message Foo { | ||
extensions 10 to 100; | ||
|
||
message Bar { | ||
optional int32 len = 1; | ||
|
||
extend Foo { | ||
optional string str = 10; | ||
repeated string labels = 11; | ||
} | ||
} | ||
} | ||
|
||
extend Foo { | ||
optional bytes meta = 20; | ||
repeated uint64 tags = 21; | ||
optional Foo ch = 22; | ||
} |
Oops, something went wrong.