Skip to content

Commit

Permalink
Correct test compilation failures for features not previously included.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
iliekturtles committed Apr 30, 2018
1 parent de55871 commit 385ff6b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions src/si/electric_potential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ mod tests {
let _: ElectricPotential<V> = Area::new::<a::square_meter>(V::one())
* Mass::new::<m::kilogram>(V::one())
/ (ElectricCurrent::new::<i::ampere>(V::one())
* Time::new::<t::second>(V::one()).powi(::typenum::P3::new()));
* (Time::new::<t::second>(V::one()) * Time::new::<t::second>(V::one())
* Time::new::<t::second>(V::one())));
}

#[test]
Expand Down Expand Up @@ -89,7 +90,8 @@ mod tests {
Test::assert_approx_eq(&ElectricPotential::new::<E>(V::one()),
&(Area::new::<a::square_meter>(V::one()) * Mass::new::<m::kilogram>(V::one())
/ (ElectricCurrent::new::<I>(V::one())
* Time::new::<t::second>(V::one()).powi(::typenum::P3::new()))));
* (Time::new::<t::second>(V::one()) * Time::new::<t::second>(V::one())
* Time::new::<t::second>(V::one())))));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/si/energy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ mod tests {
fn check_dimension() {
let _: Energy<V> = Area::new::<a::square_meter>(V::one())
* Mass::new::<m::kilogram>(V::one())
/ Time::new::<t::second>(V::one()).powi(::typenum::P2::new());
/ (Time::new::<t::second>(V::one()) * Time::new::<t::second>(V::one()));
}

#[test]
Expand All @@ -110,7 +110,7 @@ mod tests {
Test::assert_approx_eq(&Energy::new::<E>(V::one()),
&(Area::new::<a::square_meter>(V::one())
* Mass::new::<M>(V::one())
/ Time::new::<t::second>(V::one()).powi(::typenum::P2::new())));
/ (Time::new::<t::second>(V::one()) * Time::new::<t::second>(V::one()))));
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/si/ratio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ mod tests {

#[test]
fn from() {
let v = V::one();
let r1: Ratio<V> = Ratio::<V>::from(v);
let r2: Ratio<V> = v.into();
let r1: Ratio<V> = Ratio::<V>::from(V::one());
let r2: Ratio<V> = V::one().into();
let _: V = V::from(r1);
let _: V = r2.into();
}
Expand Down

0 comments on commit 385ff6b

Please sign in to comment.