deduplicate tests

This commit is contained in:
Ralf Jung 2019-05-15 14:45:15 +02:00
parent b9517ca9f3
commit 3618992a39

View File

@ -1,5 +1,7 @@
use rand::{SeedableRng, FromEntropy, Rng, rngs::SmallRng};
// Having more than 1 test does seem to make a difference
// (i.e., this calls ptr::swap which having just one test does not).
#[test]
fn simple() {
assert_eq!(4, 4);
@ -7,14 +9,6 @@ fn simple() {
// Having more than 1 test does seem to make a difference
// (i.e., this calls ptr::swap which having just one test does not).
#[test]
fn fixed_rng() {
let mut rng = rand::rngs::StdRng::seed_from_u64(0xdeadcafe);
let x: u32 = rng.gen();
let y: u32 = rng.gen();
assert_ne!(x, y);
}
#[test]
fn entropy_rng() {
// Use this opportunity to test querying the RNG (needs an external crate, hence tested here and not in the compiletest suite)