Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ldm0 committed Sep 16, 2024
1 parent bb2e902 commit 75692e6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/src/boxed_field.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax = "proto3";

package boxed_field;

message Foo {
Bar bar = 1;
}

message Bar {
}
5 changes: 5 additions & 0 deletions tests/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ fn main() {
.compile_protos(&[src.join("type_names.proto")], includes)
.unwrap();

prost_build::Config::new()
.boxed("Foo.bar")
.compile_protos(&[src.join("boxed_field.proto")], includes)
.unwrap();

// Check that attempting to compile a .proto without a package declaration does not result in an error.
config
.compile_protos(&[src.join("no_package.proto")], includes)
Expand Down
4 changes: 4 additions & 0 deletions tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ pub mod invalid {
}
}

pub mod boxed_field {
include!(concat!(env!("OUT_DIR"), "/boxed_field.rs"));
}

pub mod default_string_escape {
include!(concat!(env!("OUT_DIR"), "/default_string_escape.rs"));
}
Expand Down

0 comments on commit 75692e6

Please sign in to comment.