Inline snapshots for all tests in runnables.rs

This commit is contained in:
Phil Ellison 2019-07-28 11:57:56 +01:00
parent 8f71614bdd
commit a72331f223
5 changed files with 68 additions and 88 deletions

View file

@ -92,7 +92,26 @@ mod tests {
"#,
);
let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot_matches!("runnables", &runnables)
assert_debug_snapshot_matches!(&runnables,
@r#"[
Runnable {
range: [1; 21),
kind: Bin,
},
Runnable {
range: [22; 46),
kind: Test {
name: "test_foo",
},
},
Runnable {
range: [47; 81),
kind: Test {
name: "test_foo",
},
},
]"#
);
}
#[test]
@ -108,7 +127,22 @@ mod tests {
"#,
);
let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot_matches!("runnables_module", &runnables)
assert_debug_snapshot_matches!(&runnables,
@r#"[
Runnable {
range: [1; 59),
kind: TestMod {
path: "test_mod",
},
},
Runnable {
range: [28; 57),
kind: Test {
name: "test_foo1",
},
},
]"#
);
}
#[test]
@ -126,7 +160,22 @@ mod tests {
"#,
);
let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot_matches!("runnables_one_depth_layer_module", &runnables)
assert_debug_snapshot_matches!(&runnables,
@r#"[
Runnable {
range: [23; 85),
kind: TestMod {
path: "foo::test_mod",
},
},
Runnable {
range: [46; 79),
kind: Test {
name: "test_foo1",
},
},
]"#
);
}
#[test]
@ -146,7 +195,22 @@ mod tests {
"#,
);
let runnables = analysis.runnables(pos.file_id).unwrap();
assert_debug_snapshot_matches!("runnables_multiple_depth_module", &runnables)
assert_debug_snapshot_matches!(&runnables,
@r#"[
Runnable {
range: [41; 115),
kind: TestMod {
path: "foo::bar::test_mod",
},
},
Runnable {
range: [68; 105),
kind: Test {
name: "test_foo1",
},
},
]"#
);
}
#[test]

View file

@ -1,24 +0,0 @@
---
created: "2019-05-23T22:23:35.217100106Z"
creator: insta@0.8.1
source: crates/ra_ide_api/src/runnables.rs
expression: "&runnables"
---
[
Runnable {
range: [1; 21),
kind: Bin,
},
Runnable {
range: [22; 46),
kind: Test {
name: "test_foo",
},
},
Runnable {
range: [47; 81),
kind: Test {
name: "test_foo",
},
},
]

View file

@ -1,20 +0,0 @@
---
created: "2019-05-23T22:23:35.219258850Z"
creator: insta@0.8.1
source: crates/ra_ide_api/src/runnables.rs
expression: "&runnables"
---
[
Runnable {
range: [1; 59),
kind: TestMod {
path: "test_mod",
},
},
Runnable {
range: [28; 57),
kind: Test {
name: "test_foo1",
},
},
]

View file

@ -1,20 +0,0 @@
---
created: "2019-05-23T22:23:35.219671663Z"
creator: insta@0.8.1
source: crates/ra_ide_api/src/runnables.rs
expression: "&runnables"
---
[
Runnable {
range: [41; 115),
kind: TestMod {
path: "foo::bar::test_mod",
},
},
Runnable {
range: [68; 105),
kind: Test {
name: "test_foo1",
},
},
]

View file

@ -1,20 +0,0 @@
---
created: "2019-05-23T22:23:35.224315047Z"
creator: insta@0.8.1
source: crates/ra_ide_api/src/runnables.rs
expression: "&runnables"
---
[
Runnable {
range: [23; 85),
kind: TestMod {
path: "foo::test_mod",
},
},
Runnable {
range: [46; 79),
kind: Test {
name: "test_foo1",
},
},
]