Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev authored and taiki-e committed May 7, 2021
1 parent 08a9aa3 commit 84c2fed
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
12 changes: 12 additions & 0 deletions futures-test/src/lib.rs
Expand Up @@ -61,5 +61,17 @@ mod track_closed;
/// assert!(fut.await);
/// }
/// ```
///
/// This is equivalent to the following code:
///
/// ```
/// #[test]
/// fn my_test() {
/// futures::executor::block_on(async move {
/// let fut = async { true };
/// assert!(fut.await);
/// })
/// }
/// ```
#[cfg(feature = "std")]
pub use futures_macro::test_internal as test;
27 changes: 12 additions & 15 deletions futures/tests/test_macro.rs
@@ -1,18 +1,15 @@
#[cfg(test)]
mod tests {
#[futures_test::test]
async fn it_works() {
let fut = async { true };
assert!(fut.await);
#[futures_test::test]
async fn it_works() {
let fut = async { true };
assert!(fut.await);

let fut = async { false };
assert!(!fut.await);
}
let fut = async { false };
assert!(!fut.await);
}

#[futures_test::test]
#[should_panic]
async fn it_is_being_run() {
let fut = async { false };
assert!(fut.await);
}
#[should_panic]
#[futures_test::test]
async fn it_is_being_run() {
let fut = async { false };
assert!(fut.await);
}

0 comments on commit 84c2fed

Please sign in to comment.