aboutsummaryrefslogtreecommitdiff
path: root/macros/src/injectable/macro_args.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-08-01 17:27:50 +0200
committerHampusM <hampus@hampusmat.com>2023-08-01 17:27:50 +0200
commit6400a3b818eac49b35cd6e73a7c4df6540285bf6 (patch)
tree17c6d62d385a3de771c6dd4799741227ca38583b /macros/src/injectable/macro_args.rs
parentd8635c0c42cc5e277279d1da241ffa5b2620dd2e (diff)
test: clean up InjectableMacroArgs unit tests
Diffstat (limited to 'macros/src/injectable/macro_args.rs')
-rw-r--r--macros/src/injectable/macro_args.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/macros/src/injectable/macro_args.rs b/macros/src/injectable/macro_args.rs
index 6582cc6..6964352 100644
--- a/macros/src/injectable/macro_args.rs
+++ b/macros/src/injectable/macro_args.rs
@@ -146,8 +146,7 @@ mod tests
let injectable_macro_args = parse2::<InjectableMacroArgs>(input_args)?;
- assert!(matches!(injectable_macro_args.interface, None));
-
+ assert!(injectable_macro_args.interface.is_none());
assert!(injectable_macro_args.flags.is_empty());
Ok(())
@@ -173,7 +172,7 @@ mod tests
assert_eq!(
injectable_macro_args.flags,
- Punctuated::from_iter(vec![
+ Punctuated::from_iter([
MacroFlag {
flag: format_ident!("no_doc_hidden"),
is_on: LitBool::new(true, Span::call_site())
@@ -197,11 +196,11 @@ mod tests
let injectable_macro_args = parse2::<InjectableMacroArgs>(input_args)?;
- assert!(matches!(injectable_macro_args.interface, None));
+ assert!(injectable_macro_args.interface.is_none());
assert_eq!(
injectable_macro_args.flags,
- Punctuated::from_iter(vec![
+ Punctuated::from_iter([
MacroFlag {
flag: format_ident!("async"),
is_on: LitBool::new(false, Span::call_site())
@@ -217,15 +216,13 @@ mod tests
}
#[test]
- fn can_parse_with_unknown_flag() -> Result<(), Box<dyn Error>>
+ fn can_parse_with_unknown_flag()
{
let input_args = quote! {
IFoo, haha = true, async = false
};
assert!(parse2::<InjectableMacroArgs>(input_args).is_ok());
-
- Ok(())
}
#[test]