Skip to content

Commit

Permalink
Test absolute paths
Browse files Browse the repository at this point in the history
  • Loading branch information
bduffany committed Apr 21, 2023
1 parent 200968c commit 588f7f9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/proto/abs_reference.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
syntax = "proto3";

package abs_reference;

message Scope1 {
message Scope2 {
message A {}

message Scope1 {
Scope2.A field_a = 1;
.abs_reference.Scope2.B field_b_should_be_message = 2;
abs_reference.Scope2.B field_b_should_be_enum = 3;
.abs_reference.Scope1.Scope2 field_c = 4;
}

// Attempt to confuse the field references above by defining a message that
// clashes with the root package name.
message abs_reference {
// Attempt to further cause confusion by having this message define
// submessages with conflicting field types.
message Scope2 {
enum B { UNKNOWN_SCOPE2_ENUM_A = 0; }
}
}
}
}

message Scope2 {
message B {}
}
2 changes: 2 additions & 0 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ _pbjs proto/trivial.proto &
_pbjs proto/types.proto &
_pbjs proto/nesting.proto &
_pbjs proto/service.proto &
_pbjs proto/abs_reference.proto &
OUT=proto/multifile/multifile.proto _pbjs proto/multi/*.proto &
wait

Expand All @@ -65,6 +66,7 @@ _protoc ./proto/trivial.proto
_protoc ./proto/types.proto
_protoc ./proto/service.proto
_protoc ./proto/nesting.proto
_protoc ./proto/abs_reference.proto
_protoc ./proto/multifile/a.proto ./proto/multifile/b.proto --protobufjs_opt=-out=proto/multifile/multifile.ts

echo "Compiling encode.ts"
Expand Down

0 comments on commit 588f7f9

Please sign in to comment.