-
Notifications
You must be signed in to change notification settings - Fork 39
/
dump_debug.rs
62 lines (54 loc) · 1.16 KB
/
dump_debug.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
53
54
55
56
57
58
59
60
61
62
use rstest::*;
#[derive(Debug)]
struct A {}
#[fixture]
fn fu32() -> u32 {
42
}
#[fixture]
fn fstring() -> String {
"A String".to_string()
}
#[fixture]
fn ftuple() -> (A, String, i32) {
(A {}, "A String".to_string(), -12)
}
#[rstest]
#[trace]
fn single_fail(fu32: u32, fstring: String, ftuple: (A, String, i32)) {
assert!(false);
}
#[rstest]
fn no_trace_single_fail(fu32: u32, fstring: String, ftuple: (A, String, i32)) {
assert!(false);
}
#[rstest]
#[case(42, "str", ("ss", -12))]
#[case(24, "trs", ("tt", -24))]
#[trace]
fn cases_fail(#[case] u: u32, #[case] s: &str, #[case] t: (&str, i32)) {
assert!(false);
}
#[rstest]
#[case(42, "str", ("ss", -12))]
#[case(24, "trs", ("tt", -24))]
fn no_trace_cases_fail(#[case] u: u32, #[case] s: &str, #[case] t: (&str, i32)) {
assert!(false);
}
#[rstest]
#[trace]
fn matrix_fail(
#[values(1, 3)] u: u32,
#[values("rst", "srt")] s: &str,
#[values(("SS", -12), ("TT", -24))] t: (&str, i32),
) {
assert!(false);
}
#[rstest]
fn no_trace_matrix_fail(
#[values(1, 3)] u: u32,
#[values("rst", "srt")] s: &str,
#[values(("SS", -12), ("TT", -24))] t: (&str, i32),
) {
assert!(false);
}