diff --git a/serial_test_derive/src/lib.rs b/serial_test_derive/src/lib.rs index 1caaed7..c8773e2 100644 --- a/serial_test_derive/src/lib.rs +++ b/serial_test_derive/src/lib.rs @@ -503,6 +503,23 @@ mod tests { assert_eq!(format!("{}", compare), format!("{}", stream)); } + #[test] + fn test_serial_with_pub() { + let attrs = proc_macro2::TokenStream::new(); + let input = quote! { + #[test] + pub fn foo() {} + }; + let stream = local_serial_core(attrs.into(), input); + let compare = quote! { + #[test] + pub fn foo () { + serial_test::local_serial_core("", :: std :: option :: Option :: None, || {} ); + } + }; + assert_eq!(format!("{}", compare), format!("{}", stream)); + } + #[test] fn test_serial_with_timeout() { let attrs = vec![