From f73b874157ccb953b30b0a8b4d7a97dcd172ca98 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 12 Nov 2020 11:19:26 +0100 Subject: Update tests --- .../diagnostics/test_data/clippy_pass_by_ref.txt | 27 ++++++++++++++-- .../test_data/handles_macro_location.txt | 9 +++++- .../diagnostics/test_data/macro_compiler_error.txt | 36 +++++++++++++++++++--- .../rustc_incompatible_type_for_trait.txt | 9 +++++- .../test_data/rustc_mismatched_type.txt | 9 +++++- .../test_data/rustc_unused_variable.txt | 18 +++++++++-- .../test_data/rustc_unused_variable_as_hint.txt | 18 +++++++++-- .../test_data/rustc_unused_variable_as_info.txt | 18 +++++++++-- .../test_data/rustc_wrong_number_of_parameters.txt | 18 +++++++++-- .../diagnostics/test_data/snap_multi_line_fix.txt | 27 ++++++++++++++-- 10 files changed, 168 insertions(+), 21 deletions(-) (limited to 'crates') diff --git a/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt index 58d47d32a..5b2e5187a 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/clippy_pass_by_ref.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/compiler/mir/tagset.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/compiler/mir/tagset.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { @@ -29,7 +36,14 @@ [ DiagnosticRelatedInformation { location: Location { - uri: "file:///test/compiler/lib.rs", + uri: Url { + scheme: "file", + host: None, + port: None, + path: "/test/compiler/lib.rs", + query: None, + fragment: None, + }, range: Range { start: Position { line: 0, @@ -45,7 +59,14 @@ }, DiagnosticRelatedInformation { location: Location { - uri: "file:///test/compiler/mir/tagset.rs", + uri: Url { + scheme: "file", + host: None, + port: None, + path: "/test/compiler/mir/tagset.rs", + query: None, + fragment: None, + }, range: Range { start: Position { line: 41, diff --git a/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt index 6aa26bf63..116f0ff73 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/handles_macro_location.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/src/main.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/src/main.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { diff --git a/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt index 7aaffaba2..bbec6a796 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/macro_compiler_error.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/crates/hir_def/src/data.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/crates/hir_def/src/data.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { @@ -25,7 +32,14 @@ [ DiagnosticRelatedInformation { location: Location { - uri: "file:///test/crates/hir_def/src/path.rs", + uri: Url { + scheme: "file", + host: None, + port: None, + path: "/test/crates/hir_def/src/path.rs", + query: None, + fragment: None, + }, range: Range { start: Position { line: 264, @@ -47,7 +61,14 @@ fixes: [], }, MappedRustDiagnostic { - url: "file:///test/crates/hir_def/src/path.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/crates/hir_def/src/path.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { @@ -72,7 +93,14 @@ [ DiagnosticRelatedInformation { location: Location { - uri: "file:///test/crates/hir_def/src/data.rs", + uri: Url { + scheme: "file", + host: None, + port: None, + path: "/test/crates/hir_def/src/data.rs", + query: None, + fragment: None, + }, range: Range { start: Position { line: 79, diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt index 584213420..2cbf657e5 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_incompatible_type_for_trait.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/compiler/ty/list_iter.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/compiler/ty/list_iter.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt index 2610e4e20..1142dc2ac 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_mismatched_type.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/runtime/compiler_support.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/runtime/compiler_support.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt index a8d85f008..c709de95f 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/driver/subcommand/repl.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { @@ -46,7 +53,14 @@ SnippetWorkspaceEdit { changes: Some( { - "file:///test/driver/subcommand/repl.rs": [ + Url { + scheme: "file", + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }: [ TextEdit { range: Range { start: Position { diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt index 0b8937376..632f438d7 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_hint.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/driver/subcommand/repl.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { @@ -46,7 +53,14 @@ SnippetWorkspaceEdit { changes: Some( { - "file:///test/driver/subcommand/repl.rs": [ + Url { + scheme: "file", + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }: [ TextEdit { range: Range { start: Position { diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt index 7fa9dee62..c0b79428d 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_unused_variable_as_info.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/driver/subcommand/repl.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { @@ -46,7 +53,14 @@ SnippetWorkspaceEdit { changes: Some( { - "file:///test/driver/subcommand/repl.rs": [ + Url { + scheme: "file", + host: None, + port: None, + path: "/test/driver/subcommand/repl.rs", + query: None, + fragment: None, + }: [ TextEdit { range: Range { start: Position { diff --git a/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt index ba1b98b33..782c72dbd 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/rustc_wrong_number_of_parameters.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/compiler/ty/select.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/compiler/ty/select.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { @@ -29,7 +36,14 @@ [ DiagnosticRelatedInformation { location: Location { - uri: "file:///test/compiler/ty/select.rs", + uri: Url { + scheme: "file", + host: None, + port: None, + path: "/test/compiler/ty/select.rs", + query: None, + fragment: None, + }, range: Range { start: Position { line: 218, diff --git a/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt index 3c97b2084..d3f27ab6a 100644 --- a/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt +++ b/crates/rust-analyzer/src/diagnostics/test_data/snap_multi_line_fix.txt @@ -1,6 +1,13 @@ [ MappedRustDiagnostic { - url: "file:///test/src/main.rs", + url: Url { + scheme: "file", + host: None, + port: None, + path: "/test/src/main.rs", + query: None, + fragment: None, + }, diagnostic: Diagnostic { range: Range { start: Position { @@ -29,7 +36,14 @@ [ DiagnosticRelatedInformation { location: Location { - uri: "file:///test/src/main.rs", + uri: Url { + scheme: "file", + host: None, + port: None, + path: "/test/src/main.rs", + query: None, + fragment: None, + }, range: Range { start: Position { line: 2, @@ -61,7 +75,14 @@ SnippetWorkspaceEdit { changes: Some( { - "file:///test/src/main.rs": [ + Url { + scheme: "file", + host: None, + port: None, + path: "/test/src/main.rs", + query: None, + fragment: None, + }: [ TextEdit { range: Range { start: Position { -- cgit v1.2.3