diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-04-24 13:14:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-24 13:14:26 +0200 |
| commit | 08ca4472679057539e71fdb78b9e45e74c6932db (patch) | |
| tree | 93240efca356cd1318e475709d0de0750f5ba0d5 /src/liballoc/tests/vec_deque.rs | |
| parent | aa9053a3e76ecf2a35fecee5e83e5b27582cf9df (diff) | |
| parent | eb1de2ff39de631e9fd880f1e066fbe119b23f99 (diff) | |
Rollup merge of #71476 - RalfJung:miri-test-sizes, r=kennytm
more compact way to adjust test sizes for Miri Inspired by @dtolnay
Diffstat (limited to 'src/liballoc/tests/vec_deque.rs')
| -rw-r--r-- | src/liballoc/tests/vec_deque.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/liballoc/tests/vec_deque.rs b/src/liballoc/tests/vec_deque.rs index c4b6a36bb05..762dc4be44d 100644 --- a/src/liballoc/tests/vec_deque.rs +++ b/src/liballoc/tests/vec_deque.rs @@ -954,16 +954,14 @@ fn test_append_permutations() { out } - #[cfg(not(miri))] // Miri is too slow - const MAX: usize = 5; - #[cfg(miri)] - const MAX: usize = 3; + // Miri is too slow + let max = if cfg!(miri) { 3 } else { 5 }; // Many different permutations of both the `VecDeque` getting appended to // and the one getting appended are generated to check `append`. // This ensures all 6 code paths of `append` are tested. - for src_push_back in 0..MAX { - for src_push_front in 0..MAX { + for src_push_back in 0..max { + for src_push_front in 0..max { // doesn't pop more values than are pushed for src_pop_back in 0..(src_push_back + src_push_front) { for src_pop_front in 0..(src_push_back + src_push_front - src_pop_back) { @@ -974,8 +972,8 @@ fn test_append_permutations() { src_pop_front, ); - for dst_push_back in 0..MAX { - for dst_push_front in 0..MAX { + for dst_push_back in 0..max { + for dst_push_front in 0..max { for dst_pop_back in 0..(dst_push_back + dst_push_front) { for dst_pop_front in 0..(dst_push_back + dst_push_front - dst_pop_back) |
