test.rs
Rust inline tests module pathRust test marker or harness
SHA-2565b99ee1dc5168f0a8b5ae04423e4f577dbbfaebfadcef97349b69b77f26196ce
MaleculeMd(Pa)
Evidence
1#![cfg(test)]
2
3use rand::{thread_rng, Rng};
4use rand::distributions::Uniform;
5use std::cmp::Ordering::{Equal, Greater, Less};
6use super::ParallelSliceMut;
7
8macro_rules! sort {
9 ($f:ident, $name:ident) => {
10 #[test]
11 fn $name() {
12 let mut rng = thread_rng();
13
14 for len in (0..25).chain(500..501) {
15 for &modulus in &[5, 10, 100] {
16 …
32:11… }
33 }
34
35 // Test sort with many duplicates.
36 for &len in &[1_000, 10_000, 100_000] {
37 for &modul …
75:35… tely random comparison function.
76 // This will reorder the elements *somehow*, but won't panic.
77 let mut v: Vec<_> = (0..100).collect();
78 …
96:26… ar_sort);
97sort!(par_sort_unstable_by, test_par_sort_unstable);
98
99#[test]
100fn test_par_sort_stability() {
101 for len in (2..25).chain(500..510).chain(50_000..50_010) {
⋯4 lines
107:15… the second item represents which occurrence of that
108 // number this element is, i.e. the second elements
109 // will occur in so …