mirror of
https://gitlab.com/artofrev/smallint.git
synced 2024-12-04 17:11:38 -05:00
add #[cfg(feature = "num-bigint")] to some test helper functions
This commit is contained in:
parent
7702b67f07
commit
2e081c03c5
|
@ -33,6 +33,7 @@ conversion_tests!(i64, test_i64);
|
||||||
conversion_tests!(u128, test_u128);
|
conversion_tests!(u128, test_u128);
|
||||||
conversion_tests!(i128, test_i128);
|
conversion_tests!(i128, test_i128);
|
||||||
|
|
||||||
|
#[cfg(feature = "num-bigint")]
|
||||||
fn run_tests_u_inner(test: impl Fn(BigUint)) {
|
fn run_tests_u_inner(test: impl Fn(BigUint)) {
|
||||||
for i in 0u8..=7 {
|
for i in 0u8..=7 {
|
||||||
test(BigUint::from(i));
|
test(BigUint::from(i));
|
||||||
|
@ -52,6 +53,7 @@ fn run_tests_u_inner(test: impl Fn(BigUint)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
|
#[cfg(feature = "num-bigint")]
|
||||||
fn run_tests_u_1<T: Eq + Debug>(small: impl Fn(SmallUint) -> T, big: impl Fn(&BigUint) -> T) {
|
fn run_tests_u_1<T: Eq + Debug>(small: impl Fn(SmallUint) -> T, big: impl Fn(&BigUint) -> T) {
|
||||||
run_tests_u_inner(|i| {
|
run_tests_u_inner(|i| {
|
||||||
let small_result = small(SmallUint::from(&i));
|
let small_result = small(SmallUint::from(&i));
|
||||||
|
@ -64,6 +66,7 @@ fn run_tests_u_1<T: Eq + Debug>(small: impl Fn(SmallUint) -> T, big: impl Fn(&Bi
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "num-bigint")]
|
||||||
fn run_tests_u_2<T: Eq + Debug>(
|
fn run_tests_u_2<T: Eq + Debug>(
|
||||||
small: impl Fn(SmallUint, SmallUint) -> T,
|
small: impl Fn(SmallUint, SmallUint) -> T,
|
||||||
big: impl Fn(&BigUint, &BigUint) -> T
|
big: impl Fn(&BigUint, &BigUint) -> T
|
||||||
|
@ -79,6 +82,7 @@ fn run_tests_u_2<T: Eq + Debug>(
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "num-bigint")]
|
||||||
fn run_tests_i_inner(test: impl Fn(BigInt)) {
|
fn run_tests_i_inner(test: impl Fn(BigInt)) {
|
||||||
run_tests_u_inner(|value| {
|
run_tests_u_inner(|value| {
|
||||||
test(BigInt::from_biguint(Sign::Plus, value.clone()));
|
test(BigInt::from_biguint(Sign::Plus, value.clone()));
|
||||||
|
@ -86,6 +90,7 @@ fn run_tests_i_inner(test: impl Fn(BigInt)) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "num-bigint")]
|
||||||
fn run_tests_i_1<T: Eq + Debug>(small: impl Fn(SmallInt) -> T, big: impl Fn(&BigInt) -> T) {
|
fn run_tests_i_1<T: Eq + Debug>(small: impl Fn(SmallInt) -> T, big: impl Fn(&BigInt) -> T) {
|
||||||
run_tests_i_inner(|i| {
|
run_tests_i_inner(|i| {
|
||||||
let small_result = small(SmallInt::from(&i));
|
let small_result = small(SmallInt::from(&i));
|
||||||
|
@ -98,6 +103,7 @@ fn run_tests_i_1<T: Eq + Debug>(small: impl Fn(SmallInt) -> T, big: impl Fn(&Big
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "num-bigint")]
|
||||||
fn run_tests_i_2<T: Eq + Debug>(
|
fn run_tests_i_2<T: Eq + Debug>(
|
||||||
small: impl Fn(SmallInt, SmallInt) -> T,
|
small: impl Fn(SmallInt, SmallInt) -> T,
|
||||||
big: impl Fn(&BigInt, &BigInt) -> T
|
big: impl Fn(&BigInt, &BigInt) -> T
|
||||||
|
|
Loading…
Reference in New Issue
Block a user