diff options
author | HampusM <hampus@hampusmat.com> | 2023-09-26 19:46:15 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-09-26 19:46:15 +0200 |
commit | fe4255d765d24b3a62094a02d35077a1022887bb (patch) | |
tree | ee47f81339f569ec3b42d56778c9be514cb80ae4 /macros/src/factory/declare_default_args.rs | |
parent | 267ab1dc45c7e2cb68d8238c04376a258dcf61c9 (diff) |
test: make unit tests not return Result
Diffstat (limited to 'macros/src/factory/declare_default_args.rs')
-rw-r--r-- | macros/src/factory/declare_default_args.rs | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/macros/src/factory/declare_default_args.rs b/macros/src/factory/declare_default_args.rs index f93d29d..9930f4f 100644 --- a/macros/src/factory/declare_default_args.rs +++ b/macros/src/factory/declare_default_args.rs @@ -57,8 +57,6 @@ impl Parse for DeclareDefaultFactoryMacroArgs #[cfg(test)] mod tests { - use std::error::Error; - use proc_macro2::Span; use quote::{format_ident, quote}; use syn::token::Dyn; @@ -80,13 +78,14 @@ mod tests use crate::macro_flag::MacroFlagValue; #[test] - fn can_parse_with_interface_only() -> Result<(), Box<dyn Error>> + fn can_parse_with_interface_only() { let input_args = quote! { dyn IFoo }; - let dec_def_fac_args = parse2::<DeclareDefaultFactoryMacroArgs>(input_args)?; + let dec_def_fac_args = + parse2::<DeclareDefaultFactoryMacroArgs>(input_args).unwrap(); assert_eq!( dec_def_fac_args.interface, @@ -108,18 +107,17 @@ mod tests ); assert!(dec_def_fac_args.flags.is_empty()); - - Ok(()) } #[test] - fn can_parse_with_interface_and_single_flag() -> Result<(), Box<dyn Error>> + fn can_parse_with_interface_and_single_flag() { let input_args = quote! { dyn IBar, threadsafe = true }; - let dec_def_fac_args = parse2::<DeclareDefaultFactoryMacroArgs>(input_args)?; + let dec_def_fac_args = + parse2::<DeclareDefaultFactoryMacroArgs>(input_args).unwrap(); assert_eq!( dec_def_fac_args.interface, @@ -150,18 +148,17 @@ mod tests ))) }]) ); - - Ok(()) } #[test] - fn can_parse_with_interface_and_multiple_flags() -> Result<(), Box<dyn Error>> + fn can_parse_with_interface_and_multiple_flags() { let input_args = quote! { dyn IBar, threadsafe = true, async = false }; - let dec_def_fac_args = parse2::<DeclareDefaultFactoryMacroArgs>(input_args)?; + let dec_def_fac_args = + parse2::<DeclareDefaultFactoryMacroArgs>(input_args).unwrap(); assert_eq!( dec_def_fac_args.interface, @@ -201,8 +198,6 @@ mod tests } ]) ); - - Ok(()) } #[test] |