quantity! {
quantity: ElectricFlux; "electric flux";
dimension: ISQ<
P3, P1, N3, N1, Z0, Z0, Z0>; units {
@volt_meter: prefix!(none); "V ⋅ m", "volt meter", "volt meters";
@volt_centimeter: prefix!(none) * prefix!(centi); "V ⋅ cm", "volt centimeter",
"volt centimeters";
}
}
#[cfg(test)]
mod test {
storage_types! {
use crate::num::One;
use crate::si::electric_flux as ef;
use crate::si::quantities::*;
use crate::si::electric_potential as ep;
use crate::si::length as l;
use crate::tests::Test;
#[test]
fn check_dimension() {
let _: ElectricFlux<V> = ElectricPotential::new::<ep::volt>(V::one())
* Length::new::<l::meter>(V::one());
}
#[test]
fn check_units() {
test::<ef::volt_meter, l::meter, ep::volt>();
test::<ef::volt_centimeter, l::centimeter, ep::volt>();
fn test<EF: ef::Conversion<V>, L: l::Conversion<V>, EP: ep::Conversion<V>>() {
Test::assert_approx_eq(&ElectricFlux::new::<EF>(V::one()),
&(ElectricPotential::new::<EP>(V::one())
* Length::new::<L>(V::one())));
}
}
}
}