From 1e0a39283187570526d04684a6c6bbce9b7b6d10 Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Thu, 7 Jun 2018 18:07:52 +0200 Subject: [PATCH] Remove useless test --- tests/bool.rs | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 tests/bool.rs diff --git a/tests/bool.rs b/tests/bool.rs deleted file mode 100644 index c4208a009a3..00000000000 --- a/tests/bool.rs +++ /dev/null @@ -1,23 +0,0 @@ -#![no_std] - -extern crate rand; - -use rand::SeedableRng; -use rand::rngs::SmallRng; -use rand::distributions::{Distribution, Bernoulli}; - -/// This test should make sure that we don't accidentally have undefined -/// behavior for large propabilties due to -/// https://github.com/rust-lang/rust/issues/10184. -/// Expressions like `1.0*(u64::MAX as f64) as u64` have to be avoided. -#[test] -fn large_probability() { - let p = 1. - ::core::f64::EPSILON / 2.; - assert!(p < 1.); - let d = Bernoulli::new(p); - let mut rng = SmallRng::from_seed( - [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); - for _ in 0..10 { - assert!(d.sample(&mut rng), "extremely unlikely to fail by accident"); - } -}