@@ -72,6 +72,9 @@ mod default_enum_value;
7272#[ cfg( test) ]
7373mod nesting;
7474
75+ #[ cfg( test) ]
76+ mod recursive_oneof;
77+
7578mod test_enum_named_option_value {
7679 include ! ( concat!( env!( "OUT_DIR" ) , "/myenum.optionn.rs" ) ) ;
7780}
@@ -94,10 +97,6 @@ pub mod foo {
9497 }
9598}
9699
97- pub mod recursive_oneof {
98- include ! ( concat!( env!( "OUT_DIR" ) , "/recursive_oneof.rs" ) ) ;
99- }
100-
101100/// Also for testing custom attributes, but on oneofs.
102101///
103102/// Unfortunately, an OneOf field generates a companion module in the .rs file. There's no
@@ -388,29 +387,6 @@ mod tests {
388387 set2. insert ( msg2. field ) ;
389388 }
390389
391- #[ test]
392- fn test_deep_nesting_oneof ( ) {
393- fn build_and_roundtrip ( depth : usize ) -> Result < ( ) , prost:: DecodeError > {
394- use crate :: recursive_oneof:: { a, A , C } ;
395-
396- let mut a = Box :: new ( A {
397- kind : Some ( a:: Kind :: C ( C { } ) ) ,
398- } ) ;
399- for _ in 0 ..depth {
400- a = Box :: new ( A {
401- kind : Some ( a:: Kind :: A ( a) ) ,
402- } ) ;
403- }
404-
405- let mut buf = Vec :: new ( ) ;
406- a. encode ( & mut buf) . unwrap ( ) ;
407- A :: decode ( buf. as_slice ( ) ) . map ( |_| ( ) )
408- }
409-
410- assert ! ( build_and_roundtrip( 99 ) . is_ok( ) ) ;
411- assert ! ( build_and_roundtrip( 100 ) . is_err( ) ) ;
412- }
413-
414390 #[ test]
415391 fn test_deep_nesting_group ( ) {
416392 fn build_and_roundtrip ( depth : usize ) -> Result < ( ) , prost:: DecodeError > {
@@ -434,18 +410,6 @@ mod tests {
434410 assert ! ( build_and_roundtrip( 51 ) . is_err( ) ) ;
435411 }
436412
437- #[ test]
438- fn test_recursive_oneof ( ) {
439- use crate :: recursive_oneof:: { a, A , B , C } ;
440- let _ = A {
441- kind : Some ( a:: Kind :: B ( Box :: new ( B {
442- a : Some ( Box :: new ( A {
443- kind : Some ( a:: Kind :: C ( C { } ) ) ,
444- } ) ) ,
445- } ) ) ) ,
446- } ;
447- }
448-
449413 #[ test]
450414 fn test_267_regression ( ) {
451415 // Checks that skip_field will error appropriately when given a big stack of StartGroup
0 commit comments