Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(default_string_escape): Move tests to separate module #1239

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn main() {
.compile_protos(&[src.join("derive_copy.proto")], includes)
.unwrap();

config
prost_build::Config::new()
.compile_protos(&[src.join("default_string_escape.proto")], includes)
.unwrap();

Expand Down
7 changes: 7 additions & 0 deletions tests/src/default_string_escape.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include!(concat!(env!("OUT_DIR"), "/default_string_escape.rs"));

#[test]
fn test_default_string_escape() {
let msg = Person::default();
assert_eq!(msg.name, r#"["unknown"]"#);
}
13 changes: 3 additions & 10 deletions tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ mod recursive_oneof;
#[cfg(test)]
mod groups;

#[cfg(test)]
mod default_string_escape;

mod test_enum_named_option_value {
include!(concat!(env!("OUT_DIR"), "/myenum.optionn.rs"));
}
Expand Down Expand Up @@ -115,10 +118,6 @@ pub mod proto3 {
}
}

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

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

Expand Down Expand Up @@ -394,12 +393,6 @@ mod tests {
<() as Message>::decode(&buf[..]).err().unwrap();
}

#[test]
fn test_default_string_escape() {
let msg = default_string_escape::Person::default();
assert_eq!(msg.name, r#"["unknown"]"#);
}

#[test]
fn test_proto3_presence() {
let msg = proto3::presence::A {
Expand Down