File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -3,10 +3,11 @@ use quote::quote;
33
44pub ( crate ) fn test ( args : TokenStream , item : TokenStream ) -> TokenStream {
55 if !args. is_empty ( ) {
6- return syn:: Error :: new_spanned ( args, "invalid argument" ) )
6+ return syn:: Error :: new_spanned ( proc_macro2 :: TokenStream :: from ( args) , "invalid argument" )
77 . to_compile_error ( )
88 . into ( ) ;
99 }
10+
1011 let mut input = syn:: parse_macro_input!( item as syn:: ItemFn ) ;
1112 let attrs = & input. attrs ;
1213 let vis = & input. vis ;
Original file line number Diff line number Diff line change 1+ #[ cfg( test) ]
2+ mod tests {
3+ #[ futures_test:: test]
4+ async fn it_works ( ) {
5+ let fut = async { true } ;
6+ assert ! ( fut. await ) ;
7+
8+ let fut = async { false } ;
9+ assert ! ( !fut. await ) ;
10+ }
11+
12+ #[ futures_test:: test]
13+ #[ should_panic]
14+ async fn it_is_being_run ( ) {
15+ let fut = async { false } ;
16+ assert ! ( fut. await ) ;
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments