Auto merge of #300 - cuviper:no-default-subcrates, r=cuviper
Test and fix subcrates with --no-default-features - The CI script now tests them all with --no-default-features. - bigint: testing needs rand even when the main feature is disabled. - rational: gate `FromPrimitive for Ratio<BigInt>` on having bigint.
This commit is contained in:
commit
681bbf8659
|
@ -31,5 +31,8 @@ version = "0.3.19"
|
|||
optional = true
|
||||
version = ">= 0.7.0, < 0.9.0"
|
||||
|
||||
[dev-dependencies.rand]
|
||||
version = "0.3.14"
|
||||
|
||||
[features]
|
||||
default = ["rand", "rustc-serialize"]
|
||||
|
|
|
@ -10,9 +10,11 @@ for package in bigint complex integer iter rational traits; do
|
|||
cargo test --manifest-path $package/Cargo.toml
|
||||
done
|
||||
|
||||
# Only num-traits supports no_std at the moment.
|
||||
cargo build --manifest-path traits/Cargo.toml --no-default-features
|
||||
cargo test --manifest-path traits/Cargo.toml --no-default-features
|
||||
# They all should build with minimal features too
|
||||
for package in bigint complex integer iter rational traits; do
|
||||
cargo build --manifest-path $package/Cargo.toml --no-default-features
|
||||
cargo test --manifest-path $package/Cargo.toml --no-default-features
|
||||
done
|
||||
|
||||
# Each isolated feature should also work everywhere.
|
||||
for feature in '' bigint rational complex; do
|
||||
|
|
|
@ -860,7 +860,7 @@ mod test {
|
|||
use std::str::FromStr;
|
||||
use std::i32;
|
||||
use std::f64;
|
||||
use traits::{Zero, One, Signed, FromPrimitive, Float};
|
||||
use traits::{Zero, One, Signed, FromPrimitive};
|
||||
|
||||
pub const _0: Rational = Ratio {
|
||||
numer: 0,
|
||||
|
@ -1302,6 +1302,7 @@ mod test {
|
|||
#[cfg(feature = "num-bigint")]
|
||||
#[test]
|
||||
fn test_from_float() {
|
||||
use traits::Float;
|
||||
fn test<T: Float>(given: T, (numer, denom): (&str, &str)) {
|
||||
let ratio: BigRational = Ratio::from_float(given).unwrap();
|
||||
assert_eq!(ratio,
|
||||
|
|
Loading…
Reference in New Issue