diff --git a/src/si/acceleration.rs b/src/si/acceleration.rs index b16e39d7..725d8839 100644 --- a/src/si/acceleration.rs +++ b/src/si/acceleration.rs @@ -76,34 +76,32 @@ mod tests { #[test] fn check_units() { - test(l::yottameter, a::yottameter_per_second_squared); - test(l::zettameter, a::zettameter_per_second_squared); - test(l::exameter, a::exameter_per_second_squared); - test(l::petameter, a::petameter_per_second_squared); - test(l::terameter, a::terameter_per_second_squared); - test(l::gigameter, a::gigameter_per_second_squared); - test(l::megameter, a::megameter_per_second_squared); - test(l::kilometer, a::kilometer_per_second_squared); - test(l::hectometer, a::hectometer_per_second_squared); - test(l::decameter, a::decameter_per_second_squared); - test(l::meter, a::meter_per_second_squared); - test(l::decimeter, a::decimeter_per_second_squared); - test(l::centimeter, a::centimeter_per_second_squared); - test(l::millimeter, a::millimeter_per_second_squared); - test(l::micrometer, a::micrometer_per_second_squared); - test(l::nanometer, a::nanometer_per_second_squared); - test(l::picometer, a::picometer_per_second_squared); - test(l::femtometer, a::femtometer_per_second_squared); - test(l::attometer, a::attometer_per_second_squared); - test(l::zeptometer, a::zeptometer_per_second_squared); - test(l::yoctometer, a::yoctometer_per_second_squared); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); - // TODO #17 Convert to == once PartialEq is implemented. - fn test, A: a::Conversion>(_l: L, a: A) { - Test::assert_eq(&V::one(), + fn test, A: a::Conversion>() { + Test::assert_eq(&Acceleration::new::(V::one()), &(Length::new::(V::one()) / - (Time::new::(V::one()) * Time::new::(V::one()))) - .get(a)); + (Time::new::(V::one()) * Time::new::(V::one())))); } } } diff --git a/src/si/area.rs b/src/si/area.rs index 88c70958..3de25ae5 100644 --- a/src/si/area.rs +++ b/src/si/area.rs @@ -77,38 +77,37 @@ mod tests { fn check_units() { // Values too large for f32. if TypeId::of::() == TypeId::of::() { - test(l::yottameter, a::square_yottameter); - test(l::zettameter, a::square_zettameter); + test::(); + test::(); } - test(l::exameter, a::square_exameter); - test(l::petameter, a::square_petameter); - test(l::terameter, a::square_terameter); - test(l::gigameter, a::square_gigameter); - test(l::megameter, a::square_megameter); - test(l::kilometer, a::square_kilometer); - test(l::hectometer, a::square_hectometer); - test(l::decameter, a::square_decameter); - test(l::meter, a::square_meter); - test(l::decimeter, a::square_decimeter); - test(l::centimeter, a::square_centimeter); - test(l::millimeter, a::square_millimeter); - test(l::micrometer, a::square_micrometer); - test(l::nanometer, a::square_nanometer); - test(l::picometer, a::square_picometer); - test(l::femtometer, a::square_femtometer); - test(l::attometer, a::square_attometer); - test(l::zeptometer, a::square_zeptometer); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); // Values too small for f32. if TypeId::of::() == TypeId::of::() { - test(l::yoctometer, a::square_yoctometer); + test::(); } - // TODO #17 Convert to == once PartialEq is implemented. - fn test, A: a::Conversion>(_l: L, a: A) { - Test::assert_eq(&V::one(), - &(Length::new::(V::one()) * Length::new::(V::one())).get(a)); + fn test, A: a::Conversion>() { + Test::assert_eq(&Area::new::(V::one()), + &(Length::new::(V::one()) * Length::new::(V::one()))); } } } diff --git a/src/si/force.rs b/src/si/force.rs index fedb670c..ae4d2bf2 100644 --- a/src/si/force.rs +++ b/src/si/force.rs @@ -58,71 +58,66 @@ mod tests { #[test] fn check_units() { - test(m::yottagram, l::meter, t::second, f::zettanewton); - test(m::zettagram, l::meter, t::second, f::exanewton); - test(m::exagram, l::meter, t::second, f::petanewton); - test(m::petagram, l::meter, t::second, f::teranewton); - test(m::teragram, l::meter, t::second, f::giganewton); - test(m::gigagram, l::meter, t::second, f::meganewton); - test(m::megagram, l::meter, t::second, f::kilonewton); - test(m::kilogram, l::meter, t::second, f::newton); - test(m::gram, l::meter, t::second, f::millinewton); - test(m::milligram, l::meter, t::second, f::micronewton); - test(m::microgram, l::meter, t::second, f::nanonewton); - test(m::nanogram, l::meter, t::second, f::piconewton); - test(m::picogram, l::meter, t::second, f::femtonewton); - test(m::femtogram, l::meter, t::second, f::attonewton); - test(m::attogram, l::meter, t::second, f::zeptonewton); - test(m::zeptogram, l::meter, t::second, f::yoctonewton); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); - test(m::kilogram, l::yottameter, t::second, f::yottanewton); - test(m::kilogram, l::zettameter, t::second, f::zettanewton); - test(m::kilogram, l::exameter, t::second, f::exanewton); - test(m::kilogram, l::petameter, t::second, f::petanewton); - test(m::kilogram, l::terameter, t::second, f::teranewton); - test(m::kilogram, l::gigameter, t::second, f::giganewton); - test(m::kilogram, l::megameter, t::second, f::meganewton); - test(m::kilogram, l::kilometer, t::second, f::kilonewton); - test(m::kilogram, l::hectometer, t::second, f::hectonewton); - test(m::kilogram, l::decameter, t::second, f::decanewton); - test(m::kilogram, l::meter, t::second, f::newton); - test(m::kilogram, l::decimeter, t::second, f::decinewton); - test(m::kilogram, l::centimeter, t::second, f::centinewton); - test(m::kilogram, l::millimeter, t::second, f::millinewton); - test(m::kilogram, l::micrometer, t::second, f::micronewton); - test(m::kilogram, l::nanometer, t::second, f::nanonewton); - test(m::kilogram, l::picometer, t::second, f::piconewton); - test(m::kilogram, l::femtometer, t::second, f::femtonewton); - test(m::kilogram, l::attometer, t::second, f::attonewton); - test(m::kilogram, l::zeptometer, t::second, f::zeptonewton); - test(m::kilogram, l::meter, t::second, f::newton); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); - test(m::kilogram, l::meter, t::terasecond, f::yoctonewton); - test(m::kilogram, l::meter, t::gigasecond, f::attonewton); - test(m::kilogram, l::meter, t::megasecond, f::piconewton); - test(m::kilogram, l::meter, t::kilosecond, f::micronewton); - test(m::kilogram, l::meter, t::decasecond, f::centinewton); - test(m::kilogram, l::meter, t::decisecond, f::hectonewton); - test(m::kilogram, l::meter, t::millisecond, f::meganewton); - test(m::kilogram, l::meter, t::microsecond, f::teranewton); - test(m::kilogram, l::meter, t::nanosecond, f::exanewton); - test(m::kilogram, l::meter, t::picosecond, f::yottanewton); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); - // TODO #17 Convert to == once PartialEq is implemented. fn test< M: m::Conversion, L: l::Conversion, T: t::Conversion, - F: f::Conversion - >( - _m: M, - _l: L, - _t: T, - f: F - ) { - Test::assert_approx_eq(&V::one(), &((Mass::new::(V::one()) + F: f::Conversion>() + { + Test::assert_approx_eq(&Force::new::(V::one()), + &((Mass::new::(V::one()) * Length::new::(V::one())) - / (Time::new::(V::one()) * Time::new::(V::one()))).get(f)); + / (Time::new::(V::one()) * Time::new::(V::one())))); } } } diff --git a/src/si/frequency.rs b/src/si/frequency.rs index 3a8851ac..e53c3447 100644 --- a/src/si/frequency.rs +++ b/src/si/frequency.rs @@ -55,34 +55,33 @@ mod tests { #[test] fn check_units() { - test(t::yottasecond, f::yoctohertz); - test(t::zettasecond, f::zeptohertz); - test(t::exasecond, f::attohertz); - test(t::petasecond, f::femtohertz); - test(t::terasecond, f::picohertz); - test(t::gigasecond, f::nanohertz); - test(t::megasecond, f::microhertz); - test(t::kilosecond, f::millihertz); - test(t::hectosecond, f::centihertz); - test(t::decasecond, f::decihertz); - test(t::second, f::hertz); - test(t::decisecond, f::decahertz); - test(t::centisecond, f::hectohertz); - test(t::millisecond, f::kilohertz); - test(t::microsecond, f::megahertz); - test(t::nanosecond, f::gigahertz); - test(t::picosecond, f::terahertz); - test(t::femtosecond, f::petahertz); - test(t::attosecond, f::exahertz); - test(t::zeptosecond, f::zettahertz); - test(t::yoctosecond, f::yottahertz); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); - // TODO #17 Convert to == once PartialEq is implemented. - fn test, F: f::Conversion>(t: T, f: F) { - Test::assert_approx_eq(&(V::one() / Time::new::(V::one())).get(f), - &Frequency::new::(V::one()).get(f)); - Test::assert_approx_eq(&Time::new::(V::one()).get(t), - &(V::one() / Frequency::new::(V::one())).get(t)); + fn test, F: f::Conversion>() { + Test::assert_approx_eq(&(V::one() / Time::new::(V::one())), + &Frequency::new::(V::one())); + Test::assert_approx_eq(&Time::new::(V::one()), + &(V::one() / Frequency::new::(V::one()))); } } } diff --git a/src/si/velocity.rs b/src/si/velocity.rs index 22e2e692..3ebf0e90 100644 --- a/src/si/velocity.rs +++ b/src/si/velocity.rs @@ -75,32 +75,31 @@ mod test { #[test] fn check_units() { - test(l::yottameter, v::yottameter_per_second); - test(l::zettameter, v::zettameter_per_second); - test(l::exameter, v::exameter_per_second); - test(l::petameter, v::petameter_per_second); - test(l::terameter, v::terameter_per_second); - test(l::gigameter, v::gigameter_per_second); - test(l::megameter, v::megameter_per_second); - test(l::kilometer, v::kilometer_per_second); - test(l::hectometer, v::hectometer_per_second); - test(l::decameter, v::decameter_per_second); - test(l::meter, v::meter_per_second); - test(l::decimeter, v::decimeter_per_second); - test(l::centimeter, v::centimeter_per_second); - test(l::millimeter, v::millimeter_per_second); - test(l::micrometer, v::micrometer_per_second); - test(l::nanometer, v::nanometer_per_second); - test(l::picometer, v::picometer_per_second); - test(l::femtometer, v::femtometer_per_second); - test(l::attometer, v::attometer_per_second); - test(l::zeptometer, v::zeptometer_per_second); - test(l::yoctometer, v::yoctometer_per_second); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); - // TODO #17 Convert to == once PartialEq is implemented. - fn test, E: v::Conversion>(_l: L, v: E) { - Test::assert_eq(&V::one(), - &(Length::new::(V::one()) / Time::new::(V::one())).get(v)); + fn test, E: v::Conversion>() { + Test::assert_eq(&Velocity::new::(V::one()), + &(Length::new::(V::one()) / Time::new::(V::one()))); } } } diff --git a/src/si/volume.rs b/src/si/volume.rs index c8880b9e..86056662 100644 --- a/src/si/volume.rs +++ b/src/si/volume.rs @@ -81,40 +81,39 @@ mod tests { fn check_units() { // Values too large for f32. if TypeId::of::() == TypeId::of::() { - test(l::yottameter, v::cubic_yottameter); - test(l::zettameter, v::cubic_zettameter); - test(l::exameter, v::cubic_exameter); - test(l::petameter, v::cubic_petameter); + test::(); + test::(); + test::(); + test::(); } - test(l::terameter, v::cubic_terameter); - test(l::gigameter, v::cubic_gigameter); - test(l::megameter, v::cubic_megameter); - test(l::kilometer, v::cubic_kilometer); - test(l::hectometer, v::cubic_hectometer); - test(l::decameter, v::cubic_decameter); - test(l::meter, v::cubic_meter); - test(l::decimeter, v::cubic_decimeter); - test(l::centimeter, v::cubic_centimeter); - test(l::millimeter, v::cubic_millimeter); - test(l::micrometer, v::cubic_micrometer); - test(l::nanometer, v::cubic_nanometer); - test(l::picometer, v::cubic_picometer); - test(l::femtometer, v::cubic_femtometer); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); + test::(); // Values too small for f32. if TypeId::of::() == TypeId::of::() { - test(l::attometer, v::cubic_attometer); - test(l::zeptometer, v::cubic_zeptometer); - test(l::yoctometer, v::cubic_yoctometer); + test::(); + test::(); + test::(); } - // TODO #17 Convert to == once PartialEq is implemented. - fn test, O: v::Conversion>(_l: L, v: O) { - Test::assert_eq(&V::one(), + fn test, O: v::Conversion>() { + Test::assert_eq(&Volume::new::(V::one()), &(Length::new::(V::one()) * Length::new::(V::one()) - * Length::new::(V::one())).get(v)); + * Length::new::(V::one()))); } } } diff --git a/src/system.rs b/src/system.rs index 3c90b31a..8ce4f2fc 100644 --- a/src/system.rs +++ b/src/system.rs @@ -850,6 +850,30 @@ macro_rules! system { } } + #[cfg(test)] + impl $crate::tests::Test for Quantity + where + D: Dimension + ?Sized, + U: Units + ?Sized, + V: $crate::num::Num + $crate::Conversion + $crate::tests::Test, + { + fn assert_eq(lhs: &Self, rhs: &Self) { + $crate::tests::Test::assert_eq(&lhs.value, &rhs.value); + } + + fn assert_approx_eq(lhs: &Self, rhs: &Self) { + $crate::tests::Test::assert_approx_eq(&lhs.value, &rhs.value); + } + + fn eq(lhs: &Self, rhs: &Self) -> bool { + $crate::tests::Test::eq(&lhs.value, &rhs.value) + } + + fn approx_eq(lhs: &Self, rhs: &Self) -> bool { + $crate::tests::Test::approx_eq(&lhs.value, &rhs.value) + } + } + impl $crate::num::Zero for Quantity where D: Dimension + ?Sized, diff --git a/src/tests.rs b/src/tests.rs index 4e3f31b2..465843a5 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -461,32 +461,31 @@ mod system_macro { #[allow(trivial_casts)] fn add(l: A, r: A) -> bool { - Test::eq(&(&*l + &*r), + Test::eq(&Length::new::(&*l + &*r), &(Length::new::((*l).clone()) - + Length::new::((*r).clone())).get(meter)) + + Length::new::((*r).clone()))) } #[allow(trivial_casts)] fn sub(l: A, r: A) -> bool { - Test::eq(&(&*l - &*r), + Test::eq(&Length::new::(&*l - &*r), &(Length::new::((*l).clone()) - - Length::new::((*r).clone())).get(meter)) + - Length::new::((*r).clone()))) } #[allow(trivial_casts)] fn mul_quantity(l: A, r: A) -> bool { - // TODO Use `.get(square_meter)` - Test::eq(&(&*l * &*r), + Test::eq(&/*Area::new::*/(&*l * &*r), &(Length::new::((*l).clone()) * Length::new::((*r).clone())).value) } #[allow(trivial_casts)] fn mul_v(l: A, r: A) -> bool { - Test::eq(&(&*l * &*r), - &(Length::new::((*l).clone()) * (*r).clone()).get(meter)) - && Test::eq(&(&*l * &*r), - &((*l).clone() * Length::new::((*r).clone())).get(meter)) + Test::eq(&Length::new::(&*l * &*r), + &(Length::new::((*l).clone()) * (*r).clone())) + && Test::eq(&Length::new::(&*l * &*r), + &((*l).clone() * Length::new::((*r).clone()))) } #[allow(trivial_casts)] @@ -495,7 +494,7 @@ mod system_macro { return TestResult::discard(); } - // TODO Use `.get(?)` + // TODO Use `.get(?)`, add ratio type? TestResult::from_bool( Test::eq(&(&*l / &*r), &(Length::new::((*l).clone()) @@ -508,11 +507,10 @@ mod system_macro { return TestResult::discard(); } - // TODO Use `get(meter^-1)` TestResult::from_bool( - Test::eq(&(&*l / &*r), - &(Length::new::((*l).clone()) / (*r).clone()).get(meter)) - && Test::eq(&(&*l / &*r), + Test::eq(&Length::new::(&*l / &*r), + &(Length::new::((*l).clone()) / (*r).clone())) + && Test::eq(&/*ReciprocalLength::new::*/(&*l / &*r), &((*l).clone() / Length::new::((*r).clone())).value)) } @@ -529,9 +527,9 @@ mod system_macro { } TestResult::from_bool( - Test::approx_eq(&(&*l % &*r), + Test::approx_eq(&Length::new::(&*l % &*r), &(Length::new::((*l).clone()) - % Length::new::((*r).clone())).get(meter))) + % Length::new::((*r).clone())))) } } } @@ -650,14 +648,14 @@ mod system_macro { #[allow(trivial_casts)] fn max(l: A, r: A) -> bool { - Test::eq(&l.max(*r), - &Length::new::(*l).max(Length::new::(*r)).get(meter)) + Test::eq(&Length::new::(l.max(*r)), + &Length::new::(*l).max(Length::new::(*r))) } #[allow(trivial_casts)] fn min(l: A, r: A) -> bool { - Test::eq(&l.min(*r), - &Length::new::(*l).min(Length::new::(*r)).get(meter)) + Test::eq(&Length::new::(l.min(*r)), + &Length::new::(*l).min(Length::new::(*r))) } } } @@ -674,17 +672,20 @@ mod system_macro { quickcheck! { #[allow(trivial_casts)] fn abs(v: A) -> bool { - Test::eq(&v.abs(), &Length::new::((*v).clone()).abs().get(meter)) + Test::eq(&Length::new::(v.abs()), + &Length::new::((*v).clone()).abs()) } #[allow(trivial_casts)] fn signum(v: A) -> bool { - Test::eq(&v.signum(), &Length::new::((*v).clone()).signum().get(meter)) + Test::eq(&Length::new::(v.signum()), + &Length::new::((*v).clone()).signum()) } #[allow(trivial_casts)] fn neg(l: A) -> bool { - Test::eq(&-(*l).clone(), &-Length::new::((*l).clone()).get(meter)) + Test::eq(&Length::new::(-(*l).clone()), + &-Length::new::((*l).clone())) } } } @@ -707,7 +708,7 @@ mod system_macro { f += *r; v += Length::new::(*r); - Test::eq(&f, &v.get(meter)) + Test::eq(&Length::new::(f), &v) } #[allow(trivial_casts)] @@ -718,7 +719,7 @@ mod system_macro { f -= *r; v -= Length::new::(*r); - Test::eq(&f, &v.get(meter)) + Test::eq(&Length::new::(f), &v) } #[allow(trivial_casts)] @@ -729,7 +730,7 @@ mod system_macro { f *= *r; v *= *r; - Test::eq(&f, &v.get(meter)) + Test::eq(&Length::new::(f), &v) } #[allow(trivial_casts)] @@ -744,7 +745,7 @@ mod system_macro { f /= *r; v /= *r; - TestResult::from_bool(Test::eq(&f, &v.get(meter))) + TestResult::from_bool(Test::eq(&Length::new::(f), &v)) } #[allow(trivial_casts)] @@ -759,7 +760,7 @@ mod system_macro { f %= *r; v %= Length::new::(*r); - TestResult::from_bool(Test::approx_eq(&f, &v.get(meter))) + TestResult::from_bool(Test::approx_eq(&Length::new::(f), &v)) } } } @@ -821,28 +822,27 @@ mod quantities_macro { quickcheck! { #[allow(trivial_casts)] fn add(l: A, r: A) -> bool { - Test::approx_eq(&(&*l + &*r), + Test::approx_eq(&k::Length::new::(&*l + &*r), &(k::Length::new::((*l).clone()) - + f::Length::new::((*r).clone())).get(meter)) + + f::Length::new::((*r).clone()))) } #[allow(trivial_casts)] fn sub(l: A, r: A) -> bool { - Test::approx_eq(&(&*l - &*r), + Test::approx_eq(&k::Length::new::(&*l - &*r), &(k::Length::new::((*l).clone()) - - f::Length::new::((*r).clone())).get(meter)) + - f::Length::new::((*r).clone()))) } #[allow(trivial_casts)] fn mul_quantity(l: A, r: A) -> bool { - // TODO Use `.get(square_meter)` - Test::approx_eq(&(&*l * &*r), + Test::approx_eq(&/*Area::new::*/(&*l * &*r), &(f::Length::new::((*l).clone()) * k::Length::new::((*r).clone())).value) - && Test::approx_eq(&(&*l * &*r), + && Test::approx_eq(&/*Area::new::*/(&*l * &*r), &(f::Length::new::((*l).clone()) * k::Mass::new::((*r).clone())).value) - && Test::approx_eq(&(&*l * &*r), + && Test::approx_eq(&/*Area::new::*/(&*l * &*r), &(k::Length::new::((*l).clone()) * f::Mass::new::((*r).clone())).value) } @@ -853,7 +853,7 @@ mod quantities_macro { return TestResult::discard(); } - // TODO Use `.get(?)` + // TODO Use `.get(?)`, add ratio type? TestResult::from_bool( Test::approx_eq(&(&*l / &*r), &(k::Length::new::((*l).clone()) @@ -867,9 +867,9 @@ mod quantities_macro { } TestResult::from_bool( - Test::approx_eq(&(&*l % &*r), + Test::approx_eq(&k::Length::new::(&*l % &*r), &(k::Length::new::((*l).clone()) - % f::Length::new::((*r).clone())).get(meter))) + % f::Length::new::((*r).clone())))) } } } @@ -893,7 +893,7 @@ mod quantities_macro { f += *r; v += f::Length::new::(*r); - Test::approx_eq(&f, &v.get(meter)) + Test::approx_eq(&k::Length::new::(f), &v) } #[allow(trivial_casts)] @@ -904,7 +904,7 @@ mod quantities_macro { f -= *r; v -= f::Length::new::(*r); - Test::approx_eq(&f, &v.get(meter)) + Test::approx_eq(&k::Length::new::(f), &v) } #[allow(trivial_casts)] @@ -919,7 +919,7 @@ mod quantities_macro { f %= *r; v %= f::Length::new::(*r); - TestResult::from_bool(Test::approx_eq(&f, &v.get(meter))) + TestResult::from_bool(Test::approx_eq(&k::Length::new::(f), &v)) } } @@ -1037,7 +1037,8 @@ mod static_checks { use tests::*; - assert_impl!(q; Quantity, U, V>, Clone, Copy, Send, Sync); + assert_impl!(q; Quantity, U, V>, + Clone, Copy, PartialEq, Send, Sync); } storage_types! { @@ -1045,7 +1046,8 @@ mod static_checks { use tests::*; - assert_impl!(q; Quantity, U, V>, Clone, Copy, Send, Sync, ::lib::hash::Hash); + assert_impl!(q; Quantity, U, V>, + Clone, Copy, PartialEq, Send, Sync, ::lib::hash::Hash); } storage_types! { @@ -1053,6 +1055,7 @@ mod static_checks { use tests::*; - assert_impl!(q; Quantity, U, V>, Clone, Send, Sync, ::lib::hash::Hash); + assert_impl!(q; Quantity, U, V>, + Clone, PartialEq, Send, Sync, ::lib::hash::Hash); } }