Skip to content

Commit 575a351

Browse files
committed
Fix tests
1 parent 1335f3d commit 575a351

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Diff for: src/rustfmt/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ mod test {
708708
.wait_with_output()
709709
.expect("Failed to wait on rustfmt child");
710710
assert!(!output.status.success());
711-
assert_eq!(std::str::from_utf8(&output.stdout).unwrap(), "stdin\n");
711+
assert_eq!(std::str::from_utf8(&output.stdout).unwrap(), "<stdin>\n");
712712
}
713713

714714
#[cfg(nightly)]
@@ -818,7 +818,7 @@ fn foo() {
818818
assert!(output.stdout.is_empty());
819819
let exp_err = vec![
820820
"\u{1b}[1;38;5;9merror\u{1b}[0m: \u{1b}[1minvalid attribute",
821-
"\u{1b}[0m\n \u{1b}[1;38;5;12m-->\u{1b}[0m stdin:2\n",
821+
"\u{1b}[0m\n \u{1b}[1;38;5;12m-->\u{1b}[0m <stdin>:2\n",
822822
"\u{1b}[1;38;5;12m |\u{1b}[0m\n",
823823
"\u{1b}[1;38;5;12m2 |\u{1b}[0m #![rustfmt::max_width(120)]\n",
824824
"\u{1b}[1;38;5;12m |\u{1b}[0m\n\n",

Diff for: src/test/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,9 @@ fn stdin_formatting_smoke_test() {
428428
.unwrap();
429429

430430
#[cfg(not(windows))]
431-
assert_eq!(buf, b"stdin:\n\nfn main() {}\n");
431+
assert_eq!(buf, b"<stdin>:\n\nfn main() {}\n");
432432
#[cfg(windows)]
433-
assert_eq!(buf, b"stdin:\n\nfn main() {}\r\n");
433+
assert_eq!(buf, b"<stdin>:\n\nfn main() {}\r\n");
434434
}
435435

436436
#[test]

Diff for: tests/writemode/target/stdin.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"name":"stdin","mismatches":[{"original_begin_line":1,"original_end_line":6,"expected_begin_line":1,"expected_end_line":2,"original":"\nfn\n some( )\n{\n}\nfn main () {}\n","expected":"fn some() {}\nfn main() {}\n"}]}]
1+
[{"name":"<stdin>","mismatches":[{"original_begin_line":1,"original_end_line":6,"expected_begin_line":1,"expected_end_line":2,"original":"\nfn\n some( )\n{\n}\nfn main () {}\n","expected":"fn some() {}\nfn main() {}\n"}]}]

Diff for: tests/writemode/target/stdin.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<checkstyle version="4.3"><file name="stdin"><error line="1" severity="warning" message="Should be `fn some() {}`" /><error line="2" severity="warning" message="Should be `fn main() {}`" /></file></checkstyle>
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<checkstyle version="4.3"><file name="<stdin>"><error line="1" severity="warning" message="Should be `fn some() {}`" /><error line="2" severity="warning" message="Should be `fn main() {}`" /></file></checkstyle>

0 commit comments

Comments
 (0)