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 0d0311e commit 63b24d5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/src/boxed_field.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";

package boxed_field;

message Foo {
Bar bar = 1;
}

message Bar {
string s = 1;
}
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 63b24d5

Please sign in to comment.