uint icon indicating copy to clipboard operation
uint copied to clipboard

`support/arbitrary`: We should use `rand` in tests, not `arbitrary`.

Open github-actions[bot] opened this issue 2 years ago • 0 comments

On 2022-10-28 @recmo wrote in 49f6271 “Merge pull request #195 from recmo/pow2”:

We should use rand in tests, not arbitrary.


// TODO: Instead of uniform random sampling, we should use a distribution that
// exercises different scales more. Something like sum(±2ⁱ for random i). The
// reduction step can then remove terms or make them smaller.

// TODO: We should use `rand` in tests, not `arbitrary`.

impl<'a, const BITS: usize, const LIMBS: usize> Arbitrary<'a> for Uint<BITS, LIMBS> {
    fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
        let mut limbs = [0; LIMBS];
        if let Some((last, rest)) = limbs.split_last_mut() {

From src/support/arbitrary.rs:11

github-actions[bot] avatar Oct 28 '22 20:10 github-actions[bot]