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;
61
61
/// assert!(fut.await);
62
62
/// }
63
63
/// ```
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
+ /// ```
64
76
#[ cfg( feature = "std" ) ]
65
77
pub 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 ) ;
7
5
8
- let fut = async { false } ;
9
- assert ! ( !fut. await ) ;
10
- }
6
+ let fut = async { false } ;
7
+ assert ! ( !fut. await ) ;
8
+ }
11
9
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 ) ;
18
15
}
You can’t perform that action at this time.
0 commit comments