//! Tests to generate random numbers. use distances::{number::Bool, Number}; use test_case::test_case; #[test_case(0)] #[test_case(1)] #[test_case(10)] #[test_case(100)] #[test_case(1000)] fn test_rand_gen(len: usize) { let mut rng = rand::thread_rng(); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); test_vec::(len, &mut rng); } fn test_vec(len: usize, rng: &mut R) { let vec = (0..len).map(|_| T::next_random(rng)).collect::>(); assert_eq!(vec.len(), len); }