-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#282 : add e2e test, cover also the once fixture case and add cheange…
… log lines
- Loading branch information
Showing
6 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#![no_std] | ||
|
||
use rstest::{fixture, rstest}; | ||
|
||
#[fixture] | ||
#[once] | ||
fn once_fixture() -> u64 { | ||
42 | ||
} | ||
|
||
#[fixture] | ||
#[once] | ||
fn empty_once_fixture() {} | ||
|
||
#[fixture] | ||
async fn async_fixture() -> u64 { | ||
42 | ||
} | ||
|
||
pub fn add(left: u64, right: u64) -> u64 { | ||
left + right | ||
} | ||
|
||
#[rstest] | ||
#[case("2", "2", "4")] | ||
fn it_works(#[case] left: u64, #[case] right: u64, #[case] expected: u64) { | ||
assert_eq!(add(left, right), expected); | ||
} | ||
|
||
#[rstest] | ||
async fn async_works(#[future] async_fixture: u64) { | ||
assert_eq!(42, async_fixture.await); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters