Skip to content

Commit

Permalink
Add a test for #[serial] + pub fn
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-ue committed Dec 8, 2022
1 parent 60eee70 commit 467b02f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions serial_test_derive/src/lib.rs
Expand Up @@ -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![
Expand Down

0 comments on commit 467b02f

Please sign in to comment.