From a72331f223a120101f6edac51962ac7b2aa48cde Mon Sep 17 00:00:00 2001 From: Phil Ellison Date: Sun, 28 Jul 2019 11:57:56 +0100 Subject: [PATCH] Inline snapshots for all tests in runnables.rs --- crates/ra_ide_api/src/runnables.rs | 72 +++++++++++++++++-- .../src/snapshots/tests__runnables.snap | 24 ------- .../snapshots/tests__runnables_module.snap | 20 ------ ...ests__runnables_multiple_depth_module.snap | 20 ------ ...sts__runnables_one_depth_layer_module.snap | 20 ------ 5 files changed, 68 insertions(+), 88 deletions(-) delete mode 100644 crates/ra_ide_api/src/snapshots/tests__runnables.snap delete mode 100644 crates/ra_ide_api/src/snapshots/tests__runnables_module.snap delete mode 100644 crates/ra_ide_api/src/snapshots/tests__runnables_multiple_depth_module.snap delete mode 100644 crates/ra_ide_api/src/snapshots/tests__runnables_one_depth_layer_module.snap diff --git a/crates/ra_ide_api/src/runnables.rs b/crates/ra_ide_api/src/runnables.rs index 07412a9efd9..7a3a574ad4d 100644 --- a/crates/ra_ide_api/src/runnables.rs +++ b/crates/ra_ide_api/src/runnables.rs @@ -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] diff --git a/crates/ra_ide_api/src/snapshots/tests__runnables.snap b/crates/ra_ide_api/src/snapshots/tests__runnables.snap deleted file mode 100644 index de2fadd7f54..00000000000 --- a/crates/ra_ide_api/src/snapshots/tests__runnables.snap +++ /dev/null @@ -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", - }, - }, -] diff --git a/crates/ra_ide_api/src/snapshots/tests__runnables_module.snap b/crates/ra_ide_api/src/snapshots/tests__runnables_module.snap deleted file mode 100644 index 23993a97f0f..00000000000 --- a/crates/ra_ide_api/src/snapshots/tests__runnables_module.snap +++ /dev/null @@ -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", - }, - }, -] diff --git a/crates/ra_ide_api/src/snapshots/tests__runnables_multiple_depth_module.snap b/crates/ra_ide_api/src/snapshots/tests__runnables_multiple_depth_module.snap deleted file mode 100644 index c516a61dfc1..00000000000 --- a/crates/ra_ide_api/src/snapshots/tests__runnables_multiple_depth_module.snap +++ /dev/null @@ -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", - }, - }, -] diff --git a/crates/ra_ide_api/src/snapshots/tests__runnables_one_depth_layer_module.snap b/crates/ra_ide_api/src/snapshots/tests__runnables_one_depth_layer_module.snap deleted file mode 100644 index b02e6707ef2..00000000000 --- a/crates/ra_ide_api/src/snapshots/tests__runnables_one_depth_layer_module.snap +++ /dev/null @@ -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", - }, - }, -]