// SPDX-License-Identifier: MIT //! Not a transcribed test: the helpers' `Rng` is Python's `random.Random`, checked against //! numbers CPython 3 and PyPy 3.11 print for the same calls. mod common; #[test] fn rng_is_pythons_random() { let mut r = common::Rng::new(1); let first: Vec = (0..3).map(|_| r.range(0, 700)).collect(); assert_eq!(first, [137, 582, 64]); assert_eq!(r.random(), 0.2550690257394217); assert_eq!(r.range(0, 256), 253); let mut r = common::Rng::new(7); assert_eq!((r.range(1, 5), r.range(1, 1000)), (3, 971)); }