Skip to content

Commit 783277a

Browse files
committed
Remove unnecessary range tests
1 parent c90fee7 commit 783277a

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

src/distributions/range.rs

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -471,46 +471,14 @@ range_float_impl! { f64, 64 - 52, next_u64 }
471471
#[cfg(test)]
472472
mod tests {
473473
use Rng;
474-
use distributions::{Distribution};
475474
use distributions::range::{Range, RangeImpl, RangeFloat, SampleRange};
476475

477-
#[test]
478-
fn test_fn_range() {
479-
let mut r = ::test::rng(814);
480-
for _ in 0..1000 {
481-
let a = Range::new(-3, 42).sample(&mut r);
482-
assert!(a >= -3 && a < 42);
483-
assert_eq!(Range::new(0, 1).sample(&mut r), 0);
484-
assert_eq!(Range::new(-12, -11).sample(&mut r), -12);
485-
}
486-
487-
for _ in 0..1000 {
488-
let a = Range::new(10, 42).sample(&mut r);
489-
assert!(a >= 10 && a < 42);
490-
assert_eq!(Range::new(0, 1).sample(&mut r), 0);
491-
assert_eq!(Range::new(3_000_000, 3_000_001).sample(&mut r), 3_000_000);
492-
}
493-
}
494-
495-
#[test]
496-
#[should_panic]
497-
fn test_fn_range_panic_int() {
498-
let mut r = ::test::rng(815);
499-
Range::new(5, -2).sample(&mut r);
500-
}
501-
502-
#[test]
503-
#[should_panic]
504-
fn test_fn_range_panic_usize() {
505-
let mut r = ::test::rng(816);
506-
Range::new(5, 2).sample(&mut r);
507-
}
508-
509476
#[should_panic]
510477
#[test]
511478
fn test_range_bad_limits_equal() {
512479
Range::new(10, 10);
513480
}
481+
514482
#[should_panic]
515483
#[test]
516484
fn test_range_bad_limits_flipped() {

0 commit comments

Comments
 (0)