From 0f6c048ce1a621ccd3e2080ec5aafbd053c516f4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 29 Aug 2019 16:49:10 +0300 Subject: :arrow_up: insta --- crates/ra_hir/src/nameres/tests.rs | 32 +++++++-------- crates/ra_hir/src/nameres/tests/globs.rs | 8 ++-- crates/ra_hir/src/nameres/tests/macros.rs | 8 ++-- crates/ra_hir/src/nameres/tests/mods.rs | 56 +++++++++++++-------------- crates/ra_hir/src/nameres/tests/primitives.rs | 2 +- 5 files changed, 53 insertions(+), 53 deletions(-) (limited to 'crates/ra_hir/src/nameres') diff --git a/crates/ra_hir/src/nameres/tests.rs b/crates/ra_hir/src/nameres/tests.rs index 8b0887fb5..c1dbad283 100644 --- a/crates/ra_hir/src/nameres/tests.rs +++ b/crates/ra_hir/src/nameres/tests.rs @@ -6,7 +6,7 @@ mod mods; use std::sync::Arc; -use insta::assert_snapshot_matches; +use insta::assert_snapshot; use ra_db::SourceDatabase; use test_utils::covers; @@ -97,7 +97,7 @@ fn crate_def_map_smoke_test() { enum E { V } ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮E: t ⋮S: t v @@ -130,7 +130,7 @@ fn bogus_paths() { ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮S: t v ⋮foo: t @@ -153,7 +153,7 @@ fn use_as() { pub struct Baz; ", ); - assert_snapshot_matches!(map, + assert_snapshot!(map, @r###" ⋮crate ⋮Foo: t v @@ -182,7 +182,7 @@ fn use_trees() { pub enum Quux {}; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v ⋮Quux: t @@ -215,7 +215,7 @@ fn re_exports() { pub struct Baz; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v ⋮foo: t @@ -250,7 +250,7 @@ fn std_prelude() { "test_crate": ("/lib.rs", []), }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Bar: t v ⋮Baz: t v @@ -267,7 +267,7 @@ fn can_import_enum_variant() { use self::E::V; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮E: t ⋮V: t v @@ -299,7 +299,7 @@ fn edition_2015_imports() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮bar: t ⋮foo: t @@ -326,7 +326,7 @@ fn item_map_using_self() { pub struct Baz; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v ⋮foo: t @@ -355,7 +355,7 @@ fn item_map_across_crates() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v "###); @@ -383,7 +383,7 @@ fn extern_crate_rename() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮alloc_crate: t ⋮sync: t @@ -415,7 +415,7 @@ fn extern_crate_rename_2015_edition() { }, ); - assert_snapshot_matches!(map, + assert_snapshot!(map, @r###" ⋮crate ⋮alloc_crate: t @@ -449,7 +449,7 @@ fn import_across_source_roots() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮C: t v "###); @@ -476,7 +476,7 @@ fn reexport_across_crates() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v "###); @@ -499,7 +499,7 @@ fn values_dont_shadow_extern_crates() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Bar: t v ⋮foo: v diff --git a/crates/ra_hir/src/nameres/tests/globs.rs b/crates/ra_hir/src/nameres/tests/globs.rs index e1519ca6b..7ac22b47b 100644 --- a/crates/ra_hir/src/nameres/tests/globs.rs +++ b/crates/ra_hir/src/nameres/tests/globs.rs @@ -17,7 +17,7 @@ fn glob_1() { pub struct Baz; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v ⋮Foo: t v @@ -53,7 +53,7 @@ fn glob_2() { pub use super::*; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v ⋮Foo: t v @@ -89,7 +89,7 @@ fn glob_across_crates() { "test_crate": ("/lib.rs", []), }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v "### @@ -108,7 +108,7 @@ fn glob_enum() { use self::Foo::*; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Bar: t v ⋮Baz: t v diff --git a/crates/ra_hir/src/nameres/tests/macros.rs b/crates/ra_hir/src/nameres/tests/macros.rs index 4e04740eb..631df2cef 100644 --- a/crates/ra_hir/src/nameres/tests/macros.rs +++ b/crates/ra_hir/src/nameres/tests/macros.rs @@ -17,7 +17,7 @@ fn macro_rules_are_globally_visible() { structs!(Bar, Baz); ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Foo: t v ⋮nested: t @@ -45,7 +45,7 @@ fn macro_rules_can_define_modules() { struct X; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮m: m ⋮n1: t @@ -82,7 +82,7 @@ fn macro_rules_from_other_crates_are_visible() { "foo": ("/lib.rs", []), }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Bar: t v ⋮Foo: t v @@ -129,7 +129,7 @@ fn unexpanded_macro_should_expand_by_fixedpoint_loop() { "foo": ("/lib.rs", []), }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Foo: t v ⋮bar: m diff --git a/crates/ra_hir/src/nameres/tests/mods.rs b/crates/ra_hir/src/nameres/tests/mods.rs index 6dd18df1a..4f8398460 100644 --- a/crates/ra_hir/src/nameres/tests/mods.rs +++ b/crates/ra_hir/src/nameres/tests/mods.rs @@ -19,7 +19,7 @@ fn name_res_works_for_broken_modules() { pub struct Baz; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: _ "###); @@ -41,7 +41,7 @@ fn module_resolution_works_for_non_standard_filenames() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Bar: t v ⋮foo: t @@ -67,7 +67,7 @@ fn module_resolution_works_for_raw_modules() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Bar: t v ⋮async: t @@ -94,7 +94,7 @@ fn module_resolution_decl_path() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Bar: t v ⋮foo: t @@ -110,7 +110,7 @@ fn module_resolution_module_with_path_in_mod_rs() { r###" //- /main.rs mod foo; - + //- /foo/mod.rs #[path = "baz.rs"] pub mod bar; @@ -125,7 +125,7 @@ fn module_resolution_module_with_path_in_mod_rs() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -144,7 +144,7 @@ fn module_resolution_module_with_path_non_crate_root() { r###" //- /main.rs mod foo; - + //- /foo.rs #[path = "baz.rs"] pub mod bar; @@ -159,7 +159,7 @@ fn module_resolution_module_with_path_non_crate_root() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -189,7 +189,7 @@ fn module_resolution_module_decl_path_super() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v ⋮foo: t @@ -215,7 +215,7 @@ fn module_resolution_explicit_path_mod_rs() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -243,7 +243,7 @@ fn module_resolution_relative_path() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -274,7 +274,7 @@ fn module_resolution_relative_path_2() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -302,7 +302,7 @@ fn module_resolution_explicit_path_mod_rs_2() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -327,7 +327,7 @@ fn module_resolution_explicit_path_mod_rs_with_win_separator() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -354,7 +354,7 @@ fn module_resolution_decl_inside_inline_module_with_path_attribute() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -383,7 +383,7 @@ fn module_resolution_decl_inside_inline_module() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -413,7 +413,7 @@ fn module_resolution_decl_inside_inline_module_2_with_path_attribute() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -444,7 +444,7 @@ fn module_resolution_decl_inside_inline_module_3() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -475,7 +475,7 @@ fn module_resolution_decl_inside_inline_module_empty_path() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -503,7 +503,7 @@ fn module_resolution_decl_empty_path() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -530,7 +530,7 @@ fn module_resolution_decl_inside_inline_module_relative_path() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -561,7 +561,7 @@ fn module_resolution_decl_inside_inline_module_in_crate_root() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮Baz: t v ⋮foo: t @@ -596,7 +596,7 @@ fn module_resolution_decl_inside_inline_module_in_mod_rs() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -634,7 +634,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -672,7 +672,7 @@ fn module_resolution_decl_inside_inline_module_in_non_crate_root_2() { }, ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮ @@ -701,8 +701,8 @@ fn unresolved_module_diagnostics() { ) .diagnostics(); - assert_snapshot_matches!(diagnostics, @r###" -"mod bar;": unresolved module -"### + assert_snapshot!(diagnostics, @r###" + "mod bar;": unresolved module + "### ); } diff --git a/crates/ra_hir/src/nameres/tests/primitives.rs b/crates/ra_hir/src/nameres/tests/primitives.rs index 734744835..0e2708658 100644 --- a/crates/ra_hir/src/nameres/tests/primitives.rs +++ b/crates/ra_hir/src/nameres/tests/primitives.rs @@ -12,7 +12,7 @@ fn primitive_reexport() { pub use i32 as int; ", ); - assert_snapshot_matches!(map, @r###" + assert_snapshot!(map, @r###" ⋮crate ⋮foo: t ⋮int: t -- cgit v1.2.3