Skip to content

Commit bd7d579

Browse files
committed
Improve Pareto test
1 parent 99816b7 commit bd7d579

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/distributions/pareto.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ mod tests {
6464

6565
#[test]
6666
fn sample() {
67-
let d = Pareto::new(1.0, 2.0);
67+
let scale = 1.0;
68+
let shape = 2.0;
69+
let d = Pareto::new(scale, shape);
6870
let mut rng = ::test::rng(1);
6971
for _ in 0..1000 {
70-
d.sample(&mut rng);
72+
let r = d.sample(&mut rng);
73+
assert!(r >= scale);
7174
}
7275
}
7376
}

0 commit comments

Comments
 (0)