diff --git a/Cargo.lock b/Cargo.lock index f406a5ef9a6..867a6c1dcdd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -335,9 +335,9 @@ dependencies = [ [[package]] name = "expect-test" -version = "0.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e383741ea1982866572109d1a8c807bd36aad91fca701489fdca56ef92b3b8" +checksum = "3a3cb2ab12988de61df699d210428f3a0e26907b9d0978cf2c12e65ee90adb1d" dependencies = [ "difference", "once_cell", diff --git a/crates/hir_def/Cargo.toml b/crates/hir_def/Cargo.toml index 011e4612ca1..a88b5f57eee 100644 --- a/crates/hir_def/Cargo.toml +++ b/crates/hir_def/Cargo.toml @@ -33,4 +33,4 @@ cfg = { path = "../cfg", version = "0.0.0" } tt = { path = "../tt", version = "0.0.0" } [dev-dependencies] -expect-test = "0.1" +expect-test = "1.0" diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml index 33e155a70b8..47940c36e72 100644 --- a/crates/hir_ty/Cargo.toml +++ b/crates/hir_ty/Cargo.toml @@ -31,7 +31,7 @@ syntax = { path = "../syntax", version = "0.0.0" } test_utils = { path = "../test_utils", version = "0.0.0" } [dev-dependencies] -expect-test = "0.1" +expect-test = "1.0" tracing = "0.1" tracing-subscriber = { version = "0.2", default-features = false, features = ["env-filter", "registry"] } tracing-tree = { version = "0.1.4" } diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index a15f704ca48..f0257403d20 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml @@ -36,4 +36,4 @@ ssr = { path = "../ssr", version = "0.0.0" } hir = { path = "../hir", version = "0.0.0" } [dev-dependencies] -expect-test = "0.1" +expect-test = "1.0" diff --git a/crates/ide/test_data/highlight_doctest.html b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html similarity index 100% rename from crates/ide/test_data/highlight_doctest.html rename to crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html diff --git a/crates/ide/test_data/highlight_extern_crate.html b/crates/ide/src/syntax_highlighting/test_data/highlight_extern_crate.html similarity index 100% rename from crates/ide/test_data/highlight_extern_crate.html rename to crates/ide/src/syntax_highlighting/test_data/highlight_extern_crate.html diff --git a/crates/ide/test_data/highlight_injection.html b/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html similarity index 100% rename from crates/ide/test_data/highlight_injection.html rename to crates/ide/src/syntax_highlighting/test_data/highlight_injection.html diff --git a/crates/ide/test_data/highlight_strings.html b/crates/ide/src/syntax_highlighting/test_data/highlight_strings.html similarity index 100% rename from crates/ide/test_data/highlight_strings.html rename to crates/ide/src/syntax_highlighting/test_data/highlight_strings.html diff --git a/crates/ide/test_data/highlight_unsafe.html b/crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html similarity index 100% rename from crates/ide/test_data/highlight_unsafe.html rename to crates/ide/src/syntax_highlighting/test_data/highlight_unsafe.html diff --git a/crates/ide/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html similarity index 100% rename from crates/ide/test_data/highlighting.html rename to crates/ide/src/syntax_highlighting/test_data/highlighting.html diff --git a/crates/ide/test_data/rainbow_highlighting.html b/crates/ide/src/syntax_highlighting/test_data/rainbow_highlighting.html similarity index 100% rename from crates/ide/test_data/rainbow_highlighting.html rename to crates/ide/src/syntax_highlighting/test_data/rainbow_highlighting.html diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index 1c3fea0588b..6f72a29bdc4 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs @@ -144,7 +144,7 @@ fn and(self, other: Option) -> Option<(T, U)> { } "# .trim(), - expect_file!["crates/ide/test_data/highlighting.html"], + expect_file!["./test_data/highlighting.html"], false, ); } @@ -167,7 +167,7 @@ fn bar() { } "# .trim(), - expect_file!["crates/ide/test_data/rainbow_highlighting.html"], + expect_file!["./test_data/rainbow_highlighting.html"], true, ); } @@ -220,7 +220,7 @@ fn foo() { ); }"## .trim(), - expect_file!["crates/ide/test_data/highlight_injection.html"], + expect_file!["./test_data/highlight_injection.html"], false, ); } @@ -303,7 +303,7 @@ fn main() { println!("{ничоси}", ничоси = 92); }"# .trim(), - expect_file!["crates/ide/test_data/highlight_strings.html"], + expect_file!["./test_data/highlight_strings.html"], false, ); } @@ -376,7 +376,7 @@ fn main() { } "# .trim(), - expect_file!["crates/ide/test_data/highlight_unsafe.html"], + expect_file!["./test_data/highlight_unsafe.html"], false, ); } @@ -452,7 +452,7 @@ macro_rules! noop { } "# .trim(), - expect_file!["crates/ide/test_data/highlight_doctest.html"], + expect_file!["./test_data/highlight_doctest.html"], false, ); } @@ -469,7 +469,7 @@ fn test_extern_crate() { //- /alloc/lib.rs pub struct A "#, - expect_file!["crates/ide/test_data/highlight_extern_crate.html"], + expect_file!["./test_data/highlight_extern_crate.html"], false, ); } diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index 044686a99fa..e06956d6c60 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -58,7 +58,7 @@ proc_macro_srv = { path = "../proc_macro_srv", version = "0.0.0" } winapi = "0.3.8" [dev-dependencies] -expect-test = "0.1" +expect-test = "1.0" test_utils = { path = "../test_utils" } mbe = { path = "../mbe" } tt = { path = "../tt" } diff --git a/crates/rust-analyzer/test_data/clippy_pass_by_ref.txt b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt similarity index 100% rename from crates/rust-analyzer/test_data/clippy_pass_by_ref.txt rename to crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt diff --git a/crates/rust-analyzer/test_data/handles_macro_location.txt b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt similarity index 100% rename from crates/rust-analyzer/test_data/handles_macro_location.txt rename to crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt diff --git a/crates/rust-analyzer/test_data/macro_compiler_error.txt b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt similarity index 100% rename from crates/rust-analyzer/test_data/macro_compiler_error.txt rename to crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt diff --git a/crates/rust-analyzer/test_data/rustc_incompatible_type_for_trait.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt similarity index 100% rename from crates/rust-analyzer/test_data/rustc_incompatible_type_for_trait.txt rename to crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt diff --git a/crates/rust-analyzer/test_data/rustc_mismatched_type.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt similarity index 100% rename from crates/rust-analyzer/test_data/rustc_mismatched_type.txt rename to crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt diff --git a/crates/rust-analyzer/test_data/rustc_unused_variable.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt similarity index 100% rename from crates/rust-analyzer/test_data/rustc_unused_variable.txt rename to crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt diff --git a/crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt similarity index 100% rename from crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt rename to crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt diff --git a/crates/rust-analyzer/test_data/rustc_unused_variable_as_info.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt similarity index 100% rename from crates/rust-analyzer/test_data/rustc_unused_variable_as_info.txt rename to crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt diff --git a/crates/rust-analyzer/test_data/rustc_wrong_number_of_parameters.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt similarity index 100% rename from crates/rust-analyzer/test_data/rustc_wrong_number_of_parameters.txt rename to crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt diff --git a/crates/rust-analyzer/test_data/snap_multi_line_fix.txt b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt similarity index 100% rename from crates/rust-analyzer/test_data/snap_multi_line_fix.txt rename to crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs index e52b97913a3..f69a949f213 100644 --- a/crates/rust-analyzer/src/diagnostics/to_proto.rs +++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs @@ -315,7 +315,7 @@ fn rustc_incompatible_type_for_trait() { "rendered": "error[E0053]: method `next` has an incompatible type for trait\n --> compiler/ty/list_iter.rs:52:5\n |\n52 | fn next(&self) -> Option<&'list ty::Ref> {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability\n |\n = note: expected type `fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref>`\n found type `fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref>`\n\n" } "##, - expect_file!["crates/rust-analyzer/test_data/rustc_incompatible_type_for_trait.txt"], + expect_file!["./test_data/rustc_incompatible_type_for_trait.txt"], ); } @@ -394,7 +394,7 @@ fn rustc_unused_variable() { ], "rendered": "warning: unused variable: `foo`\n --> driver/subcommand/repl.rs:291:9\n |\n291 | let foo = 42;\n | ^^^ help: consider prefixing with an underscore: `_foo`\n |\n = note: #[warn(unused_variables)] on by default\n\n" }"##, - expect_file!["crates/rust-analyzer/test_data/rustc_unused_variable.txt"], + expect_file!["./test_data/rustc_unused_variable.txt"], ); } @@ -478,7 +478,7 @@ fn rustc_unused_variable_as_info() { ], "rendered": "warning: unused variable: `foo`\n --> driver/subcommand/repl.rs:291:9\n |\n291 | let foo = 42;\n | ^^^ help: consider prefixing with an underscore: `_foo`\n |\n = note: #[warn(unused_variables)] on by default\n\n" }"##, - expect_file!["crates/rust-analyzer/test_data/rustc_unused_variable_as_info.txt"], + expect_file!["./test_data/rustc_unused_variable_as_info.txt"], ); } @@ -562,7 +562,7 @@ fn rustc_unused_variable_as_hint() { ], "rendered": "warning: unused variable: `foo`\n --> driver/subcommand/repl.rs:291:9\n |\n291 | let foo = 42;\n | ^^^ help: consider prefixing with an underscore: `_foo`\n |\n = note: #[warn(unused_variables)] on by default\n\n" }"##, - expect_file!["crates/rust-analyzer/test_data/rustc_unused_variable_as_hint.txt"], + expect_file!["./test_data/rustc_unused_variable_as_hint.txt"], ); } @@ -683,7 +683,7 @@ fn rustc_wrong_number_of_parameters() { "children": [], "rendered": "error[E0061]: this function takes 2 parameters but 3 parameters were supplied\n --> compiler/ty/select.rs:104:18\n |\n104 | self.add_evidence(target_fixed, evidence_fixed, false);\n | ^^^^^^^^^^^^ expected 2 parameters\n...\n219 | / pub fn add_evidence(\n220 | | &mut self,\n221 | | target_poly: &ty::Ref,\n222 | | evidence_poly: &ty::Ref,\n... |\n230 | | }\n231 | | }\n | |_____- defined here\n\n" }"##, - expect_file!["crates/rust-analyzer/test_data/rustc_wrong_number_of_parameters.txt"], + expect_file!["./test_data/rustc_wrong_number_of_parameters.txt"], ); } @@ -800,7 +800,7 @@ fn clippy_pass_by_ref() { ], "rendered": "warning: this argument is passed by reference, but would be more efficient if passed by value\n --> compiler/mir/tagset.rs:42:24\n |\n42 | pub fn is_disjoint(&self, other: Self) -> bool {\n | ^^^^^ help: consider passing by value instead: `self`\n |\nnote: lint level defined here\n --> compiler/lib.rs:1:9\n |\n1 | #![warn(clippy::all)]\n | ^^^^^^^^^^^\n = note: #[warn(clippy::trivially_copy_pass_by_ref)] implied by #[warn(clippy::all)]\n = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref\n\n" }"##, - expect_file!["crates/rust-analyzer/test_data/clippy_pass_by_ref.txt"], + expect_file!["./test_data/clippy_pass_by_ref.txt"], ); } @@ -840,7 +840,7 @@ fn rustc_mismatched_type() { "children": [], "rendered": "error[E0308]: mismatched types\n --> runtime/compiler_support.rs:48:65\n |\n48 | let layout = alloc::Layout::from_size_align_unchecked(size, align);\n | ^^^^^ expected usize, found u32\n\n" }"##, - expect_file!["crates/rust-analyzer/test_data/rustc_mismatched_type.txt"], + expect_file!["./test_data/rustc_mismatched_type.txt"], ); } @@ -1108,7 +1108,7 @@ fn handles_macro_location() { } ] }"##, - expect_file!["crates/rust-analyzer/test_data/handles_macro_location.txt"], + expect_file!["./test_data/handles_macro_location.txt"], ); } @@ -1334,7 +1334,7 @@ fn macro_compiler_error() { ] } "##, - expect_file!["crates/rust-analyzer/test_data/macro_compiler_error.txt"], + expect_file!["./test_data/macro_compiler_error.txt"], ); } @@ -1464,7 +1464,7 @@ fn snap_multi_line_fix() { ] } "##, - expect_file!["crates/rust-analyzer/test_data/snap_multi_line_fix.txt"], + expect_file!["./test_data/snap_multi_line_fix.txt"], ); } } diff --git a/crates/ssr/Cargo.toml b/crates/ssr/Cargo.toml index 6f0f53d7051..408140014bb 100644 --- a/crates/ssr/Cargo.toml +++ b/crates/ssr/Cargo.toml @@ -22,4 +22,4 @@ hir = { path = "../hir", version = "0.0.0" } test_utils = { path = "../test_utils", version = "0.0.0" } [dev-dependencies] -expect-test = "0.1" +expect-test = "1.0" diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 2c1bdb2957f..af61bb65856 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml @@ -30,6 +30,6 @@ parser = { path = "../parser", version = "0.0.0" } [dev-dependencies] walkdir = "2.3.1" rayon = "1" -expect-test = "0.1" +expect-test = "1.0" test_utils = { path = "../test_utils" }