8000 Add xfail test-case to for future circular dependency scenario · fixpoint/python-betterproto@ec75740 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec75740

Browse files
Add xfail test-case to for future circular dependency scenario
1 parent 8a42027 commit ec75740

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
syntax = "proto3";
2+
3+
import "root.proto";
4+
import "other.proto";
5+
6+
// This test-case verifies that future implementations will support circular dependencies in the generated python files.
7+
//
8+
// This becomes important when generating 1 python file/module per package, rather than 1 file per proto file.
9+
//
10+
// Scenario:
11+
//
12+
// The proto messages depend on each other in a non-circular way:
13+
//
14+
// Test -------> RootPackageMessage <--------------.
15+
// `------------------------------------> OtherPackageMessage
16+
//
17+
// Test and RootPackageMessage are in different files, but belong to the same package (root):
18+
//
19+
// (Test -------> RootPackageMessage) <------------.
20+
// `------------------------------------> OtherPackageMessage
21+
//
22+
// After grouping the packages into single files or modules, a circular dependency is created:
23+
//
24+
// (root: Test & RootPackageMessage) <-------> (other: OtherPackageMessage)
25+
message Test {
26+
RootPackageMessage message = 1;
27+
other.OtherPackageMessage other =2;
28+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
syntax = "proto3";
2+
3+
import "root.proto";
4+
package other;
5+
6+
message OtherPackageMessage {
7+
RootPackageMessage rootPackageMessage = 1;
8+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
syntax = "proto3";
2+
3+
message RootPackageMessage {
4+
5+
}

0 commit comments

Comments
 (0)
0