mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-10 07:04:22 +00:00
⬆️ expect-test
This commit is contained in:
parent
c9c0050fff
commit
c692b5d76d
26 changed files with 25 additions and 25 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -144,7 +144,7 @@ impl<T> Option<T> {
|
|||
}
|
||||
"#
|
||||
.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 main() {
|
|||
);
|
||||
}"##
|
||||
.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,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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" }
|
||||
|
|
|
@ -315,7 +315,7 @@ mod tests {
|
|||
"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<M>> {\n | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ types differ in mutability\n |\n = note: expected type `fn(&mut ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&ty::Ref<M>>`\n found type `fn(&ty::list_iter::ListIterator<'list, M>) -> std::option::Option<&'list ty::Ref<M>>`\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 @@ mod tests {
|
|||
],
|
||||
"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 @@ mod tests {
|
|||
],
|
||||
"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 @@ mod tests {
|
|||
],
|
||||
"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 @@ mod tests {
|
|||
"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<ty::Poly>,\n222 | | evidence_poly: &ty::Ref<ty::Poly>,\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 @@ mod tests {
|
|||
],
|
||||
"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 @@ mod tests {
|
|||
"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 @@ mod tests {
|
|||
}
|
||||
]
|
||||
}"##,
|
||||
expect_file!["crates/rust-analyzer/test_data/handles_macro_location.txt"],
|
||||
expect_file!["./test_data/handles_macro_location.txt"],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1334,7 +1334,7 @@ mod tests {
|
|||
]
|
||||
}
|
||||
"##,
|
||||
expect_file!["crates/rust-analyzer/test_data/macro_compiler_error.txt"],
|
||||
expect_file!["./test_data/macro_compiler_error.txt"],
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1464,7 +1464,7 @@ mod tests {
|
|||
]
|
||||
}
|
||||
"##,
|
||||
expect_file!["crates/rust-analyzer/test_data/snap_multi_line_fix.txt"],
|
||||
expect_file!["./test_data/snap_multi_line_fix.txt"],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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" }
|
||||
|
|
Loading…
Reference in a new issue