about summary refs log tree commit diff
path: root/library/std/src/io/tests.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-08-04 09:16:42 -0400
committerRalf Jung <post@ralfj.de>2022-08-18 18:07:39 -0400
commit8c8dc125b1bfca49ac8f064b365cb72a658e7cba (patch)
treef3a2f741e3b6573b204fd4074e5fd7f7731c5c5e /library/std/src/io/tests.rs
parent27b044433367d7305f71bcf67dd9b5be0a0bd65a (diff)
downloadrust-8c8dc125b1bfca49ac8f064b365cb72a658e7cba.tar.gz
rust-8c8dc125b1bfca49ac8f064b365cb72a658e7cba.zip
make many std tests work in Miri
Diffstat (limited to 'library/std/src/io/tests.rs')
-rw-r--r--library/std/src/io/tests.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/std/src/io/tests.rs b/library/std/src/io/tests.rs
index f357f33ec52..68a19eccc0e 100644
--- a/library/std/src/io/tests.rs
+++ b/library/std/src/io/tests.rs
@@ -94,7 +94,7 @@ fn read_to_end() {
     assert_eq!(c.read_to_end(&mut v).unwrap(), 1);
     assert_eq!(v, b"1");
 
-    let cap = 1024 * 1024;
+    let cap = if cfg!(miri) { 1024 } else { 1024 * 1024 };
     let data = (0..cap).map(|i| (i / 3) as u8).collect::<Vec<_>>();
     let mut v = Vec::new();
     let (a, b) = data.split_at(data.len() / 2);
@@ -309,6 +309,7 @@ fn chain_zero_length_read_is_not_eof() {
 
 #[bench]
 #[cfg_attr(target_os = "emscripten", ignore)]
+#[cfg_attr(miri, ignore)] // Miri isn't fast...
 fn bench_read_to_end(b: &mut test::Bencher) {
     b.iter(|| {
         let mut lr = repeat(1).take(10000000);