mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Remove fragile test
This test needs to be updated after every change (it contains line number), which is annoying. It also fails on windows due to \, so it's easier to remove it.
This commit is contained in:
parent
18e4e9fb0b
commit
175e48e5be
1 changed files with 2 additions and 29 deletions
|
@ -78,7 +78,8 @@ impl Expect {
|
||||||
line_start += line.len();
|
line_start += line.len();
|
||||||
}
|
}
|
||||||
let (literal_start, line_indent) = target_line.unwrap();
|
let (literal_start, line_indent) = target_line.unwrap();
|
||||||
let literal_length = file[literal_start..].find("]]").expect("Couldn't find matching `]]` for `expect![[`.");
|
let literal_length =
|
||||||
|
file[literal_start..].find("]]").expect("Couldn't find matching `]]` for `expect![[`.");
|
||||||
let literal_range = literal_start..literal_start + literal_length;
|
let literal_range = literal_start..literal_start + literal_length;
|
||||||
Location { line_indent, literal_range }
|
Location { line_indent, literal_range }
|
||||||
}
|
}
|
||||||
|
@ -238,34 +239,6 @@ fn workspace_root() -> PathBuf {
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_expect_macro() {
|
|
||||||
let empty = expect![[]];
|
|
||||||
expect![[r#"
|
|
||||||
Expect {
|
|
||||||
file: "crates/expect/src/lib.rs",
|
|
||||||
line: 241,
|
|
||||||
column: 21,
|
|
||||||
data: "",
|
|
||||||
}
|
|
||||||
"#]]
|
|
||||||
.assert_debug_eq(&empty);
|
|
||||||
|
|
||||||
let expect = expect![["
|
|
||||||
hello
|
|
||||||
world
|
|
||||||
"]];
|
|
||||||
expect![[r#"
|
|
||||||
Expect {
|
|
||||||
file: "crates/expect/src/lib.rs",
|
|
||||||
line: 252,
|
|
||||||
column: 22,
|
|
||||||
data: "\n hello\n world\n ",
|
|
||||||
}
|
|
||||||
"#]]
|
|
||||||
.assert_debug_eq(&expect);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_format_patch() {
|
fn test_format_patch() {
|
||||||
let patch = format_patch(0, "hello\nworld\n");
|
let patch = format_patch(0, "hello\nworld\n");
|
||||||
|
|
Loading…
Reference in a new issue