Skip to content

Commit 91a6401

Browse files
committed
Fix ui-fulldep test
1 parent a8ffc7f commit 91a6401

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/test/ui-fulldeps/issues-81357-unsound-file-methods.rs src/test/ui-fulldeps/issue-81357-unsound-file-methods.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,9 @@ fn main() {
5555
let b = buf[0]; // capture buf[0]
5656
thread::sleep(Duration::from_millis(200));
5757

58-
// In this test, success is indicated by failing.
59-
if buf[0] == b {
60-
panic!("Success!");
61-
}
58+
// Check the buffer hasn't been written to after read.
59+
dbg!(buf[0], b);
60+
assert_eq!(buf[0], b);
6261
}
6362
}
6463
})
@@ -71,6 +70,12 @@ fn main() {
7170
let _ = server.write(b"x");
7271
thread::sleep(Duration::from_millis(100));
7372
let _ = server.write(b"y");
74-
let _ = t1.join();
75-
let _ = t2.join();
73+
74+
// This is run fail because we need to test for the `abort`.
75+
// That failing to run is the success case.
76+
if t1.join().is_err() || t2.join().is_err() {
77+
return;
78+
} else {
79+
panic!("success");
80+
}
7681
}

0 commit comments

Comments
 (0)