File tree Expand file tree Collapse file tree 2 files changed +24
-15
lines changed Expand file tree Collapse file tree 2 files changed +24
-15
lines changed Original file line number Diff line number Diff line change @@ -61,5 +61,17 @@ mod track_closed;
6161/// assert!(fut.await);
6262/// }
6363/// ```
64+ ///
65+ /// This is equivalent to the following code:
66+ ///
67+ /// ```
68+ /// #[test]
69+ /// fn my_test() {
70+ /// futures::executor::block_on(async move {
71+ /// let fut = async { true };
72+ /// assert!(fut.await);
73+ /// })
74+ /// }
75+ /// ```
6476#[ cfg( feature = "std" ) ]
6577pub use futures_macro:: test_internal as test;
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 ) ;
1+ #[ futures_test:: test]
2+ async fn it_works ( ) {
3+ let fut = async { true } ;
4+ assert ! ( fut. await ) ;
75
8- let fut = async { false } ;
9- assert ! ( !fut. await ) ;
10- }
6+ let fut = async { false } ;
7+ assert ! ( !fut. await ) ;
8+ }
119
12- #[ futures_test:: test]
13- #[ should_panic]
14- async fn it_is_being_run ( ) {
15- let fut = async { false } ;
16- assert ! ( fut. await ) ;
17- }
10+ #[ should_panic]
11+ #[ futures_test:: test]
12+ async fn it_is_being_run ( ) {
13+ let fut = async { false } ;
14+ assert ! ( fut. await ) ;
1815}
You can’t perform that action at this time.
0 commit comments