-
Notifications
You must be signed in to change notification settings - Fork 39
/
errors.rs
52 lines (41 loc) · 804 Bytes
/
errors.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use rstest::*;
#[fixture]
pub fn fixture() -> u32 { 42 }
#[fixture]
fn error_inner(fixture: u32) {
let a: u32 = "";
}
#[fixture]
fn error_cannot_resolve_fixture(no_fixture: u32) {
}
#[fixture]
fn error_fixture_wrong_type(fixture: String) {
}
#[fixture(not_a_fixture(24))]
fn error_inject_an_invalid_fixture(fixture: String) {
}
#[fixture]
fn name() -> &'static str {
"name"
}
#[fixture]
fn f(name: &str) -> String {
name.to_owned()
}
#[fixture(f("first"), f("second"))]
fn error_inject_a_fixture_more_than_once(f: String) {
}
#[fixture]
#[once]
async fn error_async_once_fixture() {
}
#[fixture]
#[once]
fn error_generics_once_fixture<T: std::fmt::Debug>() -> T {
42
}
#[fixture]
#[once]
fn error_generics_once_fixture() -> impl Iterator<Item: u32> {
std::iter::once(42)
}