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;
3
3
4
4
pub ( crate ) fn test ( args : TokenStream , item : TokenStream ) -> TokenStream {
5
5
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" )
7
7
. to_compile_error ( )
8
8
. into ( ) ;
9
9
}
10
+
10
11
let mut input = syn:: parse_macro_input!( item as syn:: ItemFn ) ;
11
12
let attrs = & input. attrs ;
12
13
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