Closed shaobo-he closed 3 years ago
Hello,
It appears this test will always pass even setting QUICKCHECK_TESTS and QUICKCHECK_MAX_TESTS to a large value (e.g., 10000000) and QUICKCHECK_GENERATOR_SIZE to 300,
QUICKCHECK_TESTS
QUICKCHECK_MAX_TESTS
10000000
QUICKCHECK_GENERATOR_SIZE
300
fn prop_gt(x: i8) -> bool { x != i8::min_value() } fn main() { quickcheck(prop_gt as fn(i8) -> bool); println!("Hello, world!"); }
It appears these lines of code attribute to this issue, https://docs.rs/quickcheck/0.8.2/src/quickcheck/arbitrary.rs.html#756-771 If upper = min(g.size(), $ty::max_value() as usize), then if upper > $ty::max_value() always evaluates to the else branch.
upper = min(g.size(), $ty::max_value() as usize)
if upper > $ty::max_value()
Hello,
It appears this test will always pass even setting
QUICKCHECK_TESTS
andQUICKCHECK_MAX_TESTS
to a large value (e.g.,10000000
) andQUICKCHECK_GENERATOR_SIZE
to300
,It appears these lines of code attribute to this issue, https://docs.rs/quickcheck/0.8.2/src/quickcheck/arbitrary.rs.html#756-771 If
upper = min(g.size(), $ty::max_value() as usize)
, thenif upper > $ty::max_value()
always evaluates to the else branch.