The test modules were getting huge, and some of its functions were actually a huge amount of code due to macros, causing tests to take a long time just to compile. They are now separated into a few different tests, and the scalar macros especially are now expanded more sparingly in just a few `check()` functions. Test compile times for me went from about 25 seconds to 1.5s in debug mode, and from 300 seconds (!) to about 8s in release mode.
66 lines
1.9 KiB
Rust
66 lines
1.9 KiB
Rust
#![allow(unused)]
|
|
|
|
use num_bigint::BigDigit;
|
|
|
|
pub const N1: BigDigit = -1i32 as BigDigit;
|
|
pub const N2: BigDigit = -2i32 as BigDigit;
|
|
|
|
pub const SUM_TRIPLES: &'static [(
|
|
&'static [BigDigit],
|
|
&'static [BigDigit],
|
|
&'static [BigDigit],
|
|
)] = &[
|
|
(&[], &[], &[]),
|
|
(&[], &[1], &[1]),
|
|
(&[1], &[1], &[2]),
|
|
(&[1], &[1, 1], &[2, 1]),
|
|
(&[1], &[N1], &[0, 1]),
|
|
(&[1], &[N1, N1], &[0, 0, 1]),
|
|
(&[N1, N1], &[N1, N1], &[N2, N1, 1]),
|
|
(&[1, 1, 1], &[N1, N1], &[0, 1, 2]),
|
|
(&[2, 2, 1], &[N1, N2], &[1, 1, 2]),
|
|
];
|
|
|
|
pub const M: u32 = ::std::u32::MAX;
|
|
pub const MUL_TRIPLES: &'static [(
|
|
&'static [BigDigit],
|
|
&'static [BigDigit],
|
|
&'static [BigDigit],
|
|
)] = &[
|
|
(&[], &[], &[]),
|
|
(&[], &[1], &[]),
|
|
(&[2], &[], &[]),
|
|
(&[1], &[1], &[1]),
|
|
(&[2], &[3], &[6]),
|
|
(&[1], &[1, 1, 1], &[1, 1, 1]),
|
|
(&[1, 2, 3], &[3], &[3, 6, 9]),
|
|
(&[1, 1, 1], &[N1], &[N1, N1, N1]),
|
|
(&[1, 2, 3], &[N1], &[N1, N2, N2, 2]),
|
|
(&[1, 2, 3, 4], &[N1], &[N1, N2, N2, N2, 3]),
|
|
(&[N1], &[N1], &[1, N2]),
|
|
(&[N1, N1], &[N1], &[1, N1, N2]),
|
|
(&[N1, N1, N1], &[N1], &[1, N1, N1, N2]),
|
|
(&[N1, N1, N1, N1], &[N1], &[1, N1, N1, N1, N2]),
|
|
(&[M / 2 + 1], &[2], &[0, 1]),
|
|
(&[0, M / 2 + 1], &[2], &[0, 0, 1]),
|
|
(&[1, 2], &[1, 2, 3], &[1, 4, 7, 6]),
|
|
(&[N1, N1], &[N1, N1, N1], &[1, 0, N1, N2, N1]),
|
|
(&[N1, N1, N1], &[N1, N1, N1, N1], &[1, 0, 0, N1, N2, N1, N1]),
|
|
(&[0, 0, 1], &[1, 2, 3], &[0, 0, 1, 2, 3]),
|
|
(&[0, 0, 1], &[0, 0, 0, 1], &[0, 0, 0, 0, 0, 1]),
|
|
];
|
|
|
|
pub const DIV_REM_QUADRUPLES: &'static [(
|
|
&'static [BigDigit],
|
|
&'static [BigDigit],
|
|
&'static [BigDigit],
|
|
&'static [BigDigit],
|
|
)] = &[
|
|
(&[1], &[2], &[], &[1]),
|
|
(&[3], &[2], &[1], &[1]),
|
|
(&[1, 1], &[2], &[M / 2 + 1], &[1]),
|
|
(&[1, 1, 1], &[2], &[M / 2 + 1, M / 2 + 1], &[1]),
|
|
(&[0, 1], &[N1], &[1], &[1]),
|
|
(&[N1, N1], &[N2], &[2, 1], &[3]),
|
|
];
|