Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Account for changed format range in a test
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Apr 6, 2019
1 parent 7157a37 commit e17a9e4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions tests/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1802,17 +1802,14 @@ fn client_reformat_with_range() {
let newline = if cfg!(windows) { "\r\n" } else { "\n" };
let formatted = r#"pub fn main() {
let world1 = "world";
println!("Hello, {}!", world1);
// Work around rustfmt#3494
let world2 = "world"; println!("Hello, {}!", world2);
let world3 = "world"; println!("Hello, {}!", world3);
}
"#
println!("Hello, {}!", world1);"#
.replace("\r", "")
.replace("\n", newline);

assert_eq!(result.unwrap()[0].new_text, formatted);
let edits = result.unwrap();
assert_eq!(edits.len(), 2);
assert_eq!(edits[0].new_text, formatted);
assert_eq!(edits[1].new_text, "");
}

#[test]
Expand Down

0 comments on commit e17a9e4

Please sign in to comment.