about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <christophersdenton@gmail.com>2022-07-06 18:47:44 +0100
committerMark Rousskov <mark.simulacrum@gmail.com>2022-07-15 17:59:56 -0400
commitbcb9c2352bc8f45a5f4e5d57fdb68cfbc6161b24 (patch)
tree150e3b884e06f118df5b67b9472553ef1c11998c
parentb2ec40b91c83f9cb97410f602af42d8299aa570d (diff)
downloadrust-bcb9c2352bc8f45a5f4e5d57fdb68cfbc6161b24.tar.gz
rust-bcb9c2352bc8f45a5f4e5d57fdb68cfbc6161b24.zip
Fix ui-fulldep test
-rw-r--r--src/test/ui-fulldeps/issue-81357-unsound-file-methods.rs (renamed from src/test/ui-fulldeps/issues-81357-unsound-file-methods.rs)17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/test/ui-fulldeps/issues-81357-unsound-file-methods.rs b/src/test/ui-fulldeps/issue-81357-unsound-file-methods.rs
index 94b5798a0e7..fdf1150f8d2 100644
--- a/src/test/ui-fulldeps/issues-81357-unsound-file-methods.rs
+++ b/src/test/ui-fulldeps/issue-81357-unsound-file-methods.rs
@@ -55,10 +55,9 @@ fn main() {
                     let b = buf[0]; // capture buf[0]
                     thread::sleep(Duration::from_millis(200));
 
-                    // In this test, success is indicated by failing.
-                    if buf[0] == b {
-                        panic!("Success!");
-                    }
+                    // Check the buffer hasn't been written to after read.
+                    dbg!(buf[0], b);
+                    assert_eq!(buf[0], b);
                 }
             }
         })
@@ -71,6 +70,12 @@ fn main() {
     let _ = server.write(b"x");
     thread::sleep(Duration::from_millis(100));
     let _ = server.write(b"y");
-    let _ = t1.join();
-    let _ = t2.join();
+
+    // This is run fail because we need to test for the `abort`.
+    // That failing to run is the success case.
+    if t1.join().is_err() || t2.join().is_err() {
+        return;
+    } else {
+        panic!("success");
+    }
 }