mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 13:18:47 +00:00
Switch to expect_test from crates.io
This commit is contained in:
parent
66e0c9f840
commit
b0fd3faf36
45 changed files with 54 additions and 54 deletions
19
Cargo.lock
generated
19
Cargo.lock
generated
|
@ -345,12 +345,13 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "expect"
|
||||
version = "0.0.0"
|
||||
name = "expect-test"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a3e383741ea1982866572109d1a8c807bd36aad91fca701489fdca56ef92b3b8"
|
||||
dependencies = [
|
||||
"difference",
|
||||
"once_cell",
|
||||
"stdx",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -508,7 +509,7 @@ dependencies = [
|
|||
"cfg",
|
||||
"drop_bomb",
|
||||
"either",
|
||||
"expect",
|
||||
"expect-test",
|
||||
"fst",
|
||||
"hir_expand",
|
||||
"indexmap",
|
||||
|
@ -553,7 +554,7 @@ dependencies = [
|
|||
"chalk-recursive",
|
||||
"chalk-solve",
|
||||
"ena",
|
||||
"expect",
|
||||
"expect-test",
|
||||
"hir_def",
|
||||
"hir_expand",
|
||||
"itertools",
|
||||
|
@ -587,7 +588,7 @@ dependencies = [
|
|||
"base_db",
|
||||
"cfg",
|
||||
"either",
|
||||
"expect",
|
||||
"expect-test",
|
||||
"hir",
|
||||
"ide_db",
|
||||
"indexmap",
|
||||
|
@ -1225,7 +1226,7 @@ dependencies = [
|
|||
"cfg",
|
||||
"crossbeam-channel",
|
||||
"env_logger",
|
||||
"expect",
|
||||
"expect-test",
|
||||
"flycheck",
|
||||
"hir",
|
||||
"hir_def",
|
||||
|
@ -1452,7 +1453,7 @@ name = "ssr"
|
|||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"base_db",
|
||||
"expect",
|
||||
"expect-test",
|
||||
"hir",
|
||||
"ide_db",
|
||||
"itertools",
|
||||
|
@ -1494,7 +1495,7 @@ name = "syntax"
|
|||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"expect",
|
||||
"expect-test",
|
||||
"itertools",
|
||||
"once_cell",
|
||||
"parser",
|
||||
|
|
|
@ -32,4 +32,4 @@ cfg = { path = "../cfg" }
|
|||
tt = { path = "../tt" }
|
||||
|
||||
[dev-dependencies]
|
||||
expect = { path = "../expect" }
|
||||
expect-test = "0.1"
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use expect::expect;
|
||||
use expect_test::expect;
|
||||
use test_utils::mark;
|
||||
|
||||
use super::{check_infer, check_infer_with_mismatches};
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use expect::expect;
|
||||
use expect_test::expect;
|
||||
|
||||
use super::{check_infer, check_types};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use expect::expect;
|
||||
use expect_test::expect;
|
||||
|
||||
use super::{check_infer_with_mismatches, check_types};
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use expect::expect;
|
||||
use expect_test::expect;
|
||||
use test_utils::mark;
|
||||
|
||||
use super::{check_infer, check_infer_with_mismatches};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use expect::expect;
|
||||
use expect_test::expect;
|
||||
use test_utils::mark;
|
||||
|
||||
use super::{check_infer, check_types};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use expect::expect;
|
||||
use expect_test::expect;
|
||||
|
||||
use super::{check_infer, check_types};
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -32,4 +32,4 @@ ssr = { path = "../ssr" }
|
|||
hir = { path = "../hir" }
|
||||
|
||||
[dev-dependencies]
|
||||
expect = { path = "../expect" }
|
||||
expect-test = "0.1"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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},
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use expect::{expect, Expect};
|
||||
use expect_test::{expect, Expect};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
|
|
@ -353,7 +353,7 @@ fn pick_best(tokens: TokenAtOffset<SyntaxToken>) -> Option<SyntaxToken> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use base_db::FileLoader;
|
||||
use expect::{expect, Expect};
|
||||
use expect_test::{expect, Expect};
|
||||
|
||||
use crate::mock_analysis::analysis_and_position;
|
||||
|
||||
|
|
|
@ -336,7 +336,7 @@ fn get_callable(sema: &Semantics<RootDatabase>, expr: &ast::Expr) -> Option<Call
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use expect::{expect, Expect};
|
||||
use expect_test::{expect, Expect};
|
||||
use test_utils::extract_annotations;
|
||||
|
||||
use crate::{inlay_hints::InlayHintsConfig, mock_analysis::single_file};
|
||||
|
|
|
@ -270,7 +270,7 @@ fn rename_reference(
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use expect::{expect, Expect};
|
||||
use expect_test::{expect, Expect};
|
||||
use stdx::trim_indent;
|
||||
use test_utils::{assert_eq_text, mark};
|
||||
use text_edit::TextEdit;
|
||||
|
|
|
@ -268,7 +268,7 @@ fn has_test_function_or_multiple_test_submodules(module: &ast::Module) -> bool {
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use expect::{expect, Expect};
|
||||
use expect_test::{expect, Expect};
|
||||
|
||||
use crate::mock_analysis::analysis_and_position;
|
||||
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -22,4 +22,4 @@ hir = { path = "../hir" }
|
|||
test_utils = { path = "../test_utils" }
|
||||
|
||||
[dev-dependencies]
|
||||
expect = { path = "../expect" }
|
||||
expect-test = "0.1"
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue