aboutsummaryrefslogtreecommitdiff
path: root/src/invoke.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-23 23:23:56 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-23 23:23:56 +0800
commitf9f879e488a62eba9c54c8e713cc94cc9f20e96e (patch)
treee311493f8c491f5a14bedde9e54f3c90c0a3dbdb /src/invoke.rs
parentee4a0ad75a52960ce674098986ce2b7be1cfe4e7 (diff)
feat(config): refactor default feature name parsing
Diffstat (limited to 'src/invoke.rs')
-rw-r--r--src/invoke.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/invoke.rs b/src/invoke.rs
index f7da20a..2ada0b4 100644
--- a/src/invoke.rs
+++ b/src/invoke.rs
@@ -86,4 +86,21 @@ mod tests {
_ => panic!("expected Explicit variant"),
}
}
+
+ #[test]
+ fn explicit_missing_arrow_is_rejected() {
+ let input: proc_macro2::TokenStream = r#""ft" expr()"#.parse().unwrap();
+ assert!(syn::parse2::<InvokeArgs>(input).is_err());
+ }
+
+ #[test]
+ fn integer_parses_as_default_variant() {
+ // integer literal is not a LitStr, so it falls through to Default variant
+ let input: proc_macro2::TokenStream = "42".parse().unwrap();
+ let args: InvokeArgs = syn::parse2(input).unwrap();
+ match args {
+ InvokeArgs::Default(_) => {} // expected
+ _ => panic!("expected Default variant"),
+ }
+ }
}