mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-19 08:40:24 +00:00
Refactor goto tests to always specify texts
This commit is contained in:
parent
69c944a1e2
commit
46a299bcee
2 changed files with 76 additions and 52 deletions
|
@ -207,8 +207,8 @@ pub fn lines_match(expected: &str, actual: &str) -> bool {
|
|||
// Let's not deal with / vs \ (windows...)
|
||||
// First replace backslash-escaped backslashes with forward slashes
|
||||
// which can occur in, for example, JSON output
|
||||
let expected = expected.replace("\\\\", "/").replace("\\", "/");
|
||||
let mut actual: &str = &actual.replace("\\\\", "/").replace("\\", "/");
|
||||
let expected = expected.replace(r"\\", "/").replace(r"\", "/");
|
||||
let mut actual: &str = &actual.replace(r"\\", "/").replace(r"\", "/");
|
||||
for (i, part) in expected.split("[..]").enumerate() {
|
||||
match actual.find(part) {
|
||||
Some(j) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue