Skip to content

Commit

Permalink
Add missing unit tests and adjust precision of knot.
Browse files Browse the repository at this point in the history
Tests for `inch_per_second` and `knot` were missing. Additional
precision was required for the `knot`.
  • Loading branch information
iliekturtles committed Apr 27, 2019
1 parent 21b59ad commit f331fdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/si/acceleration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ mod tests {

test::<l::foot, t::second, a::foot_per_second_squared>();
test::<l::centimeter, t::second, a::galileo>();
test::<l::inch, t::second, a::inch_per_second_squared>();
test::<l::millimeter, t::minute, a::millimeter_per_minute_squared>();

fn test<L: l::Conversion<V>, T: t::Conversion<V>, A: a::Conversion<V>>() {
Expand Down
3 changes: 2 additions & 1 deletion src/si/velocity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ quantity! {
@inch_per_second: 2.54_E-2; "in/s", "inch per second", "inches per second";
@kilometer_per_hour: 2.777_777_777_777_778_E-1; "km/h", "kilometer per hour",
"kilometers per hour";
@knot: 5.144_444_E-1; "kn", "knot", "knots";
@knot: 5.144_444_444_444_445_E-1; "kn", "knot", "knots";
@mile_per_hour: 4.470_4_E-1; "mi/h", "mile per hour", "miles per hour";
@mile_per_minute: 2.682_24_E1; "mi/min", "mile per minute", "miles per minute";
@mile_per_second: 1.609_344_E3; "mi/s", "mile per second", "miles per second";
Expand Down Expand Up @@ -115,6 +115,7 @@ mod test {
test::<l::foot, t::second, v::foot_per_second>();
test::<l::inch, t::second, v::inch_per_second>();
test::<l::kilometer, t::hour, v::kilometer_per_hour>();
test::<l::nautical_mile, t::hour, v::knot>();
test::<l::mile, t::hour, v::mile_per_hour>();
test::<l::mile, t::second, v::mile_per_second>();
test::<l::millimeter, t::minute, v::millimeter_per_minute>();
Expand Down

0 comments on commit f331fdc

Please sign in to comment.