File tree Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Expand file tree Collapse file tree 3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ fn main() {
9999 . compile_protos ( & [ src. join ( "derive_copy.proto" ) ] , includes)
100100 . unwrap ( ) ;
101101
102- config
102+ prost_build :: Config :: new ( )
103103 . compile_protos ( & [ src. join ( "default_string_escape.proto" ) ] , includes)
104104 . unwrap ( ) ;
105105
Original file line number Diff line number Diff line change 1+ include ! ( concat!( env!( "OUT_DIR" ) , "/default_string_escape.rs" ) ) ;
2+
3+ #[ test]
4+ fn test_default_string_escape ( ) {
5+ let msg = Person :: default ( ) ;
6+ assert_eq ! ( msg. name, r#"["unknown"]"# ) ;
7+ }
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ mod recursive_oneof;
7878#[ cfg( test) ]
7979mod groups;
8080
81+ #[ cfg( test) ]
82+ mod default_string_escape;
83+
8184mod test_enum_named_option_value {
8285 include ! ( concat!( env!( "OUT_DIR" ) , "/myenum.optionn.rs" ) ) ;
8386}
@@ -115,10 +118,6 @@ pub mod proto3 {
115118 }
116119}
117120
118- pub mod default_string_escape {
119- include ! ( concat!( env!( "OUT_DIR" ) , "/default_string_escape.rs" ) ) ;
120- }
121-
122121#[ cfg( not( feature = "std" ) ) ]
123122use alloc:: vec:: Vec ;
124123
@@ -394,12 +393,6 @@ mod tests {
394393 <( ) as Message >:: decode ( & buf[ ..] ) . err ( ) . unwrap ( ) ;
395394 }
396395
397- #[ test]
398- fn test_default_string_escape ( ) {
399- let msg = default_string_escape:: Person :: default ( ) ;
400- assert_eq ! ( msg. name, r#"["unknown"]"# ) ;
401- }
402-
403396 #[ test]
404397 fn test_proto3_presence ( ) {
405398 let msg = proto3:: presence:: A {
You can’t perform that action at this time.
0 commit comments