Skip to content

Commit

Permalink
make num sampling functions public
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed May 20, 2023
1 parent 6eb7574 commit fb2d578
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion proptest/src/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ use crate::test_runner::TestRunner;
use rand::distributions::uniform::{SampleUniform, Uniform};
use rand::distributions::{Distribution, Standard};

/// Generate a random value of `X`, sampled uniformly from the half
/// open range `[low, high)` (excluding `high`). Panics if `low >= high`.
pub(crate) fn sample_uniform<X: SampleUniform>(
run: &mut TestRunner,
start: X,
Expand All @@ -26,7 +28,9 @@ pub(crate) fn sample_uniform<X: SampleUniform>(
Uniform::new(start, end).sample(run.rng())
}

pub(crate) fn sample_uniform_incl<X: SampleUniform>(
/// Generate a random value of `X`, sampled uniformly from the closed
/// range `[low, high]` (inclusive). Panics if `low > high`.
pub fn sample_uniform_incl<X: SampleUniform>(
run: &mut TestRunner,
start: X,
end: X,
Expand Down

0 comments on commit fb2d578

Please sign in to comment.