From 385ff6b6b5c1c0c97b0dad7dcc31ab156d053ae1 Mon Sep 17 00:00:00 2001 From: Mike Boutin Date: Mon, 30 Apr 2018 13:40:59 -0400 Subject: [PATCH] Correct test compilation failures for features not previously included. Include `cargo test --no-run` for the same feature set as `cargo build` to catch these errors in the future. #52 needs to be resolved to reduce compile times before all features can be enabled. --- .appveyor.yml | 1 + .travis.yml | 1 + src/si/electric_potential.rs | 6 ++++-- src/si/energy.rs | 4 ++-- src/si/ratio.rs | 5 ++--- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 0c4b5e85..c188695e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -55,6 +55,7 @@ install: build: false test_script: - cargo build --verbose --no-default-features --features "usize isize bigint rational bigrational f32 f64 si std use_serde" + - cargo test --verbose --no-run --no-default-features --features "usize isize bigint rational bigrational f32 f64 si std use_serde" - cargo test --all --verbose --features "use_serde" notifications: diff --git a/.travis.yml b/.travis.yml index 29667854..934556a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,7 @@ before_script: | script: | cargo build --verbose --no-default-features --features "usize isize bigint rational bigrational f32 f64 si std use_serde" && + cargo test --verbose --no-run --no-default-features --features "usize isize bigint rational bigrational f32 f64 si std use_serde" && cargo test --verbose --features "use_serde $TRAVIS_RUST_VERSION" && cargo test --manifest-path tests/feature_check/Cargo.toml --verbose --features "$TRAVIS_RUST_VERSION" diff --git a/src/si/electric_potential.rs b/src/si/electric_potential.rs index 9260e16c..600af17d 100644 --- a/src/si/electric_potential.rs +++ b/src/si/electric_potential.rs @@ -58,7 +58,8 @@ mod tests { let _: ElectricPotential = Area::new::(V::one()) * Mass::new::(V::one()) / (ElectricCurrent::new::(V::one()) - * Time::new::(V::one()).powi(::typenum::P3::new())); + * (Time::new::(V::one()) * Time::new::(V::one()) + * Time::new::(V::one()))); } #[test] @@ -89,7 +90,8 @@ mod tests { Test::assert_approx_eq(&ElectricPotential::new::(V::one()), &(Area::new::(V::one()) * Mass::new::(V::one()) / (ElectricCurrent::new::(V::one()) - * Time::new::(V::one()).powi(::typenum::P3::new())))); + * (Time::new::(V::one()) * Time::new::(V::one()) + * Time::new::(V::one()))))); } } } diff --git a/src/si/energy.rs b/src/si/energy.rs index b54599ba..c68460d1 100644 --- a/src/si/energy.rs +++ b/src/si/energy.rs @@ -83,7 +83,7 @@ mod tests { fn check_dimension() { let _: Energy = Area::new::(V::one()) * Mass::new::(V::one()) - / Time::new::(V::one()).powi(::typenum::P2::new()); + / (Time::new::(V::one()) * Time::new::(V::one())); } #[test] @@ -110,7 +110,7 @@ mod tests { Test::assert_approx_eq(&Energy::new::(V::one()), &(Area::new::(V::one()) * Mass::new::(V::one()) - / Time::new::(V::one()).powi(::typenum::P2::new()))); + / (Time::new::(V::one()) * Time::new::(V::one())))); } } } diff --git a/src/si/ratio.rs b/src/si/ratio.rs index a526420e..41d9d610 100644 --- a/src/si/ratio.rs +++ b/src/si/ratio.rs @@ -71,9 +71,8 @@ mod tests { #[test] fn from() { - let v = V::one(); - let r1: Ratio = Ratio::::from(v); - let r2: Ratio = v.into(); + let r1: Ratio = Ratio::::from(V::one()); + let r2: Ratio = V::one().into(); let _: V = V::from(r1); let _: V = r2.into(); }