From b0fd3faf36c94c3fc52151c6aa82b36b43b7cceb Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Aug 2020 13:19:31 +0200 Subject: Switch to expect_test from crates.io --- crates/hir_def/Cargo.toml | 2 +- crates/hir_def/src/import_map.rs | 2 +- crates/hir_def/src/item_tree/tests.rs | 2 +- crates/hir_def/src/nameres/tests.rs | 2 +- crates/hir_ty/Cargo.toml | 3 +-- crates/hir_ty/src/tests.rs | 2 +- crates/hir_ty/src/tests/coercion.rs | 2 +- crates/hir_ty/src/tests/macros.rs | 2 +- crates/hir_ty/src/tests/method_resolution.rs | 2 +- crates/hir_ty/src/tests/never_type.rs | 2 +- crates/hir_ty/src/tests/patterns.rs | 2 +- crates/hir_ty/src/tests/regression.rs | 2 +- crates/hir_ty/src/tests/simple.rs | 2 +- crates/hir_ty/src/tests/traits.rs | 2 +- crates/ide/Cargo.toml | 2 +- crates/ide/src/call_info.rs | 2 +- crates/ide/src/completion/complete_attribute.rs | 2 +- crates/ide/src/completion/complete_dot.rs | 2 +- crates/ide/src/completion/complete_fn_param.rs | 2 +- crates/ide/src/completion/complete_keyword.rs | 2 +- crates/ide/src/completion/complete_macro_in_item_position.rs | 2 +- crates/ide/src/completion/complete_pattern.rs | 2 +- crates/ide/src/completion/complete_postfix.rs | 2 +- crates/ide/src/completion/complete_qualified_path.rs | 2 +- crates/ide/src/completion/complete_record.rs | 2 +- crates/ide/src/completion/complete_snippet.rs | 2 +- crates/ide/src/completion/complete_trait_impl.rs | 2 +- crates/ide/src/completion/complete_unqualified_path.rs | 2 +- crates/ide/src/completion/presentation.rs | 2 +- crates/ide/src/diagnostics.rs | 2 +- crates/ide/src/display/navigation_target.rs | 2 +- crates/ide/src/expand_macro.rs | 2 +- crates/ide/src/file_structure.rs | 2 +- crates/ide/src/hover.rs | 2 +- crates/ide/src/inlay_hints.rs | 2 +- crates/ide/src/references/rename.rs | 2 +- crates/ide/src/runnables.rs | 2 +- crates/ide/src/syntax_highlighting/tests.rs | 2 +- crates/rust-analyzer/Cargo.toml | 2 +- crates/rust-analyzer/src/diagnostics/to_proto.rs | 2 +- crates/ssr/Cargo.toml | 2 +- crates/ssr/src/tests.rs | 2 +- crates/syntax/Cargo.toml | 2 +- crates/syntax/src/tests.rs | 2 +- 44 files changed, 44 insertions(+), 45 deletions(-) (limited to 'crates') diff --git a/crates/hir_def/Cargo.toml b/crates/hir_def/Cargo.toml index 403bc2aff..57745322f 100644 --- a/crates/hir_def/Cargo.toml +++ b/crates/hir_def/Cargo.toml @@ -32,4 +32,4 @@ cfg = { path = "../cfg" } tt = { path = "../tt" } [dev-dependencies] -expect = { path = "../expect" } +expect-test = "0.1" diff --git a/crates/hir_def/src/import_map.rs b/crates/hir_def/src/import_map.rs index d32a0bdaf..a442fb63a 100644 --- a/crates/hir_def/src/import_map.rs +++ b/crates/hir_def/src/import_map.rs @@ -328,7 +328,7 @@ pub fn search_dependencies<'a>( #[cfg(test)] mod tests { use base_db::{fixture::WithFixture, SourceDatabase, Upcast}; - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::{test_db::TestDB, AssocContainerId, Lookup}; diff --git a/crates/hir_def/src/item_tree/tests.rs b/crates/hir_def/src/item_tree/tests.rs index 9c5bf72bd..620e697d4 100644 --- a/crates/hir_def/src/item_tree/tests.rs +++ b/crates/hir_def/src/item_tree/tests.rs @@ -1,5 +1,5 @@ use base_db::fixture::WithFixture; -use expect::{expect, Expect}; +use expect_test::{expect, Expect}; use hir_expand::{db::AstDatabase, HirFileId, InFile}; use rustc_hash::FxHashSet; use std::sync::Arc; diff --git a/crates/hir_def/src/nameres/tests.rs b/crates/hir_def/src/nameres/tests.rs index b105d56b2..8aaf7a158 100644 --- a/crates/hir_def/src/nameres/tests.rs +++ b/crates/hir_def/src/nameres/tests.rs @@ -7,7 +7,7 @@ mod primitives; use std::sync::Arc; use base_db::{fixture::WithFixture, SourceDatabase}; -use expect::{expect, Expect}; +use expect_test::{expect, Expect}; use test_utils::mark; use crate::{db::DefDatabase, nameres::*, test_db::TestDB}; diff --git a/crates/hir_ty/Cargo.toml b/crates/hir_ty/Cargo.toml index a319b0ce8..06da0d0ec 100644 --- a/crates/hir_ty/Cargo.toml +++ b/crates/hir_ty/Cargo.toml @@ -30,8 +30,7 @@ syntax = { path = "../syntax" } test_utils = { path = "../test_utils" } [dev-dependencies] +expect-test = "0.1" tracing = "0.1" tracing-subscriber = { version = "0.2", default-features = false, features = ["env-filter", "registry"] } tracing-tree = { version = "0.1.4" } - -expect = { path = "../expect" } diff --git a/crates/hir_ty/src/tests.rs b/crates/hir_ty/src/tests.rs index 91c9d38c5..0445efc9e 100644 --- a/crates/hir_ty/src/tests.rs +++ b/crates/hir_ty/src/tests.rs @@ -11,7 +11,7 @@ mod display_source_code; use std::{env, sync::Arc}; use base_db::{fixture::WithFixture, FileRange, SourceDatabase, SourceDatabaseExt}; -use expect::Expect; +use expect_test::Expect; use hir_def::{ body::{BodySourceMap, SyntheticSyntax}, child_by_source::ChildBySource, diff --git a/crates/hir_ty/src/tests/coercion.rs b/crates/hir_ty/src/tests/coercion.rs index 17efd75cb..7bc6c79f3 100644 --- a/crates/hir_ty/src/tests/coercion.rs +++ b/crates/hir_ty/src/tests/coercion.rs @@ -1,4 +1,4 @@ -use expect::expect; +use expect_test::expect; use test_utils::mark; use super::{check_infer, check_infer_with_mismatches}; diff --git a/crates/hir_ty/src/tests/macros.rs b/crates/hir_ty/src/tests/macros.rs index d887c7a79..597a195d0 100644 --- a/crates/hir_ty/src/tests/macros.rs +++ b/crates/hir_ty/src/tests/macros.rs @@ -1,6 +1,6 @@ use std::fs; -use expect::expect; +use expect_test::expect; use test_utils::project_dir; use super::{check_infer, check_types}; diff --git a/crates/hir_ty/src/tests/method_resolution.rs b/crates/hir_ty/src/tests/method_resolution.rs index fa68355aa..23b2601e6 100644 --- a/crates/hir_ty/src/tests/method_resolution.rs +++ b/crates/hir_ty/src/tests/method_resolution.rs @@ -1,4 +1,4 @@ -use expect::expect; +use expect_test::expect; use super::{check_infer, check_types}; diff --git a/crates/hir_ty/src/tests/never_type.rs b/crates/hir_ty/src/tests/never_type.rs index 49538b572..335c474df 100644 --- a/crates/hir_ty/src/tests/never_type.rs +++ b/crates/hir_ty/src/tests/never_type.rs @@ -1,4 +1,4 @@ -use expect::expect; +use expect_test::expect; use super::{check_infer_with_mismatches, check_types}; diff --git a/crates/hir_ty/src/tests/patterns.rs b/crates/hir_ty/src/tests/patterns.rs index 39fabf7eb..aeb191c79 100644 --- a/crates/hir_ty/src/tests/patterns.rs +++ b/crates/hir_ty/src/tests/patterns.rs @@ -1,4 +1,4 @@ -use expect::expect; +use expect_test::expect; use test_utils::mark; use super::{check_infer, check_infer_with_mismatches}; diff --git a/crates/hir_ty/src/tests/regression.rs b/crates/hir_ty/src/tests/regression.rs index b9ab0f357..94d86b0d1 100644 --- a/crates/hir_ty/src/tests/regression.rs +++ b/crates/hir_ty/src/tests/regression.rs @@ -1,4 +1,4 @@ -use expect::expect; +use expect_test::expect; use test_utils::mark; use super::{check_infer, check_types}; diff --git a/crates/hir_ty/src/tests/simple.rs b/crates/hir_ty/src/tests/simple.rs index 59eb59d5f..48db23a34 100644 --- a/crates/hir_ty/src/tests/simple.rs +++ b/crates/hir_ty/src/tests/simple.rs @@ -1,4 +1,4 @@ -use expect::expect; +use expect_test::expect; use super::{check_infer, check_types}; diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index 526e61caf..1f1056962 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs @@ -1,4 +1,4 @@ -use expect::expect; +use expect_test::expect; use test_utils::mark; use super::{check_infer, check_infer_with_mismatches, check_types}; diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index e4b970c73..700944430 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml @@ -32,4 +32,4 @@ ssr = { path = "../ssr" } hir = { path = "../hir" } [dev-dependencies] -expect = { path = "../expect" } +expect-test = "0.1" diff --git a/crates/ide/src/call_info.rs b/crates/ide/src/call_info.rs index 86abd2d8c..7e83a2381 100644 --- a/crates/ide/src/call_info.rs +++ b/crates/ide/src/call_info.rs @@ -229,7 +229,7 @@ impl FnCallNode { #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use test_utils::mark; use crate::mock_analysis::analysis_and_position; diff --git a/crates/ide/src/completion/complete_attribute.rs b/crates/ide/src/completion/complete_attribute.rs index 042c3ecef..0abfaebcb 100644 --- a/crates/ide/src/completion/complete_attribute.rs +++ b/crates/ide/src/completion/complete_attribute.rs @@ -383,7 +383,7 @@ const DEFAULT_LINT_COMPLETIONS: &[LintCompletion] = &[ #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{test_utils::completion_list, CompletionKind}; diff --git a/crates/ide/src/completion/complete_dot.rs b/crates/ide/src/completion/complete_dot.rs index 5488db43f..0b9f1798a 100644 --- a/crates/ide/src/completion/complete_dot.rs +++ b/crates/ide/src/completion/complete_dot.rs @@ -61,7 +61,7 @@ fn complete_methods(acc: &mut Completions, ctx: &CompletionContext, receiver: &T #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use test_utils::mark; use crate::completion::{test_utils::completion_list, CompletionKind}; diff --git a/crates/ide/src/completion/complete_fn_param.rs b/crates/ide/src/completion/complete_fn_param.rs index 7c63ce58f..9efe25461 100644 --- a/crates/ide/src/completion/complete_fn_param.rs +++ b/crates/ide/src/completion/complete_fn_param.rs @@ -66,7 +66,7 @@ pub(super) fn complete_fn_param(acc: &mut Completions, ctx: &CompletionContext) #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{test_utils::completion_list, CompletionKind}; diff --git a/crates/ide/src/completion/complete_keyword.rs b/crates/ide/src/completion/complete_keyword.rs index 22ada3cf2..95e4ff1ac 100644 --- a/crates/ide/src/completion/complete_keyword.rs +++ b/crates/ide/src/completion/complete_keyword.rs @@ -174,7 +174,7 @@ fn complete_return( #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{ test_utils::{check_edit, completion_list}, diff --git a/crates/ide/src/completion/complete_macro_in_item_position.rs b/crates/ide/src/completion/complete_macro_in_item_position.rs index 0447f0511..fc8625d8e 100644 --- a/crates/ide/src/completion/complete_macro_in_item_position.rs +++ b/crates/ide/src/completion/complete_macro_in_item_position.rs @@ -15,7 +15,7 @@ pub(super) fn complete_macro_in_item_position(acc: &mut Completions, ctx: &Compl #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{test_utils::completion_list, CompletionKind}; diff --git a/crates/ide/src/completion/complete_pattern.rs b/crates/ide/src/completion/complete_pattern.rs index aceb77cb5..5a13574d4 100644 --- a/crates/ide/src/completion/complete_pattern.rs +++ b/crates/ide/src/completion/complete_pattern.rs @@ -33,7 +33,7 @@ pub(super) fn complete_pattern(acc: &mut Completions, ctx: &CompletionContext) { #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{test_utils::completion_list, CompletionKind}; diff --git a/crates/ide/src/completion/complete_postfix.rs b/crates/ide/src/completion/complete_postfix.rs index d50b13c52..84c4e129d 100644 --- a/crates/ide/src/completion/complete_postfix.rs +++ b/crates/ide/src/completion/complete_postfix.rs @@ -238,7 +238,7 @@ fn postfix_snippet( #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{ test_utils::{check_edit, completion_list}, diff --git a/crates/ide/src/completion/complete_qualified_path.rs b/crates/ide/src/completion/complete_qualified_path.rs index 74794dc88..accb09f7e 100644 --- a/crates/ide/src/completion/complete_qualified_path.rs +++ b/crates/ide/src/completion/complete_qualified_path.rs @@ -146,7 +146,7 @@ pub(super) fn complete_qualified_path(acc: &mut Completions, ctx: &CompletionCon #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use test_utils::mark; use crate::completion::{ diff --git a/crates/ide/src/completion/complete_record.rs b/crates/ide/src/completion/complete_record.rs index 74b94594d..ceb8d16c1 100644 --- a/crates/ide/src/completion/complete_record.rs +++ b/crates/ide/src/completion/complete_record.rs @@ -18,7 +18,7 @@ pub(super) fn complete_record(acc: &mut Completions, ctx: &CompletionContext) -> #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{test_utils::completion_list, CompletionKind}; diff --git a/crates/ide/src/completion/complete_snippet.rs b/crates/ide/src/completion/complete_snippet.rs index 4368e4eec..c3b03b199 100644 --- a/crates/ide/src/completion/complete_snippet.rs +++ b/crates/ide/src/completion/complete_snippet.rs @@ -70,7 +70,7 @@ fn ${1:feature}() { #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{test_utils::completion_list, CompletionKind}; diff --git a/crates/ide/src/completion/complete_trait_impl.rs b/crates/ide/src/completion/complete_trait_impl.rs index d0d3a9f34..1a2b1e8a5 100644 --- a/crates/ide/src/completion/complete_trait_impl.rs +++ b/crates/ide/src/completion/complete_trait_impl.rs @@ -225,7 +225,7 @@ fn make_const_compl_syntax(const_: &ast::Const) -> String { #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::completion::{ test_utils::{check_edit, completion_list}, diff --git a/crates/ide/src/completion/complete_unqualified_path.rs b/crates/ide/src/completion/complete_unqualified_path.rs index 824227f31..1f1b682a7 100644 --- a/crates/ide/src/completion/complete_unqualified_path.rs +++ b/crates/ide/src/completion/complete_unqualified_path.rs @@ -64,7 +64,7 @@ fn complete_enum_variants(acc: &mut Completions, ctx: &CompletionContext, ty: &T #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use test_utils::mark; use crate::completion::{ diff --git a/crates/ide/src/completion/presentation.rs b/crates/ide/src/completion/presentation.rs index a73f8ab0b..3371aed2d 100644 --- a/crates/ide/src/completion/presentation.rs +++ b/crates/ide/src/completion/presentation.rs @@ -464,7 +464,7 @@ fn guess_macro_braces(macro_name: &str, docs: &str) -> (&'static str, &'static s mod tests { use std::cmp::Reverse; - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use test_utils::mark; use crate::{ diff --git a/crates/ide/src/diagnostics.rs b/crates/ide/src/diagnostics.rs index 92b5adaa2..b2b972b02 100644 --- a/crates/ide/src/diagnostics.rs +++ b/crates/ide/src/diagnostics.rs @@ -214,7 +214,7 @@ fn check_struct_shorthand_initialization( #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use stdx::trim_indent; use test_utils::assert_eq_text; diff --git a/crates/ide/src/display/navigation_target.rs b/crates/ide/src/display/navigation_target.rs index e77106177..1ee80c2dd 100644 --- a/crates/ide/src/display/navigation_target.rs +++ b/crates/ide/src/display/navigation_target.rs @@ -421,7 +421,7 @@ pub(crate) fn description_from_symbol(db: &RootDatabase, symbol: &FileSymbol) -> #[cfg(test)] mod tests { - use expect::expect; + use expect_test::expect; use crate::{mock_analysis::single_file, Query}; diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs index 31455709d..8a285bcf7 100644 --- a/crates/ide/src/expand_macro.rs +++ b/crates/ide/src/expand_macro.rs @@ -120,7 +120,7 @@ fn insert_whitespaces(syn: SyntaxNode) -> String { #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::mock_analysis::analysis_and_position; diff --git a/crates/ide/src/file_structure.rs b/crates/ide/src/file_structure.rs index c90247ba6..6168fb837 100644 --- a/crates/ide/src/file_structure.rs +++ b/crates/ide/src/file_structure.rs @@ -164,7 +164,7 @@ fn structure_node(node: &SyntaxNode) -> Option { #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use super::*; diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 300c00edc..c75b2a510 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -353,7 +353,7 @@ fn pick_best(tokens: TokenAtOffset) -> Option { #[cfg(test)] mod tests { use base_db::FileLoader; - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::mock_analysis::analysis_and_position; diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index 596bc872d..583f39d85 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -336,7 +336,7 @@ fn get_callable(sema: &Semantics, expr: &ast::Expr) -> Option bool { #[cfg(test)] mod tests { - use expect::{expect, Expect}; + use expect_test::{expect, Expect}; use crate::mock_analysis::analysis_and_position; diff --git a/crates/ide/src/syntax_highlighting/tests.rs b/crates/ide/src/syntax_highlighting/tests.rs index ccb76f552..1c3fea058 100644 --- a/crates/ide/src/syntax_highlighting/tests.rs +++ b/crates/ide/src/syntax_highlighting/tests.rs @@ -1,6 +1,6 @@ use std::fs; -use expect::{expect_file, ExpectFile}; +use expect_test::{expect_file, ExpectFile}; use test_utils::project_dir; use crate::{mock_analysis::single_file, FileRange, TextRange}; diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml index c7c1eda0f..068a961dc 100644 --- a/crates/rust-analyzer/Cargo.toml +++ b/crates/rust-analyzer/Cargo.toml @@ -57,7 +57,7 @@ proc_macro_srv = { path = "../proc_macro_srv" } winapi = "0.3.8" [dev-dependencies] -expect = { path = "../expect" } +expect-test = "0.1" test_utils = { path = "../test_utils" } mbe = { path = "../mbe" } tt = { path = "../tt" } diff --git a/crates/rust-analyzer/src/diagnostics/to_proto.rs b/crates/rust-analyzer/src/diagnostics/to_proto.rs index df5583897..e52b97913 100644 --- a/crates/rust-analyzer/src/diagnostics/to_proto.rs +++ b/crates/rust-analyzer/src/diagnostics/to_proto.rs @@ -256,7 +256,7 @@ pub(crate) fn map_rust_diagnostic_to_lsp( mod tests { use super::*; - use expect::{expect_file, ExpectFile}; + use expect_test::{expect_file, ExpectFile}; fn check(diagnostics_json: &str, expect: ExpectFile) { check_with_config(DiagnosticsMapConfig::default(), diagnostics_json, expect) diff --git a/crates/ssr/Cargo.toml b/crates/ssr/Cargo.toml index 7c2090de3..22b6af0fa 100644 --- a/crates/ssr/Cargo.toml +++ b/crates/ssr/Cargo.toml @@ -22,4 +22,4 @@ hir = { path = "../hir" } test_utils = { path = "../test_utils" } [dev-dependencies] -expect = { path = "../expect" } +expect-test = "0.1" diff --git a/crates/ssr/src/tests.rs b/crates/ssr/src/tests.rs index e45c88864..20231a9bc 100644 --- a/crates/ssr/src/tests.rs +++ b/crates/ssr/src/tests.rs @@ -1,6 +1,6 @@ use crate::{MatchFinder, SsrRule}; use base_db::{salsa::Durability, FileId, FilePosition, FileRange, SourceDatabaseExt}; -use expect::{expect, Expect}; +use expect_test::{expect, Expect}; use rustc_hash::FxHashSet; use std::sync::Arc; use test_utils::{mark, RangeOrOffset}; diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index ec3132da8..6818f3ad8 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml @@ -30,6 +30,6 @@ parser = { path = "../parser" } [dev-dependencies] walkdir = "2.3.1" rayon = "1" +expect-test = "0.1" test_utils = { path = "../test_utils" } -expect = { path = "../expect" } diff --git a/crates/syntax/src/tests.rs b/crates/syntax/src/tests.rs index ddc718369..8c217dfe0 100644 --- a/crates/syntax/src/tests.rs +++ b/crates/syntax/src/tests.rs @@ -4,7 +4,7 @@ use std::{ path::{Path, PathBuf}, }; -use expect::expect_file; +use expect_test::expect_file; use rayon::prelude::*; use test_utils::project_dir; -- cgit v1.2.3