Split format::test::units to per-unit tests

This commit is contained in:
Juhani Krekelä 2023-05-29 02:54:27 +03:00
parent ebff87c733
commit d6441454fc
1 changed files with 7 additions and 1 deletions

View File

@ -154,7 +154,7 @@ mod test {
}
#[test]
fn units() {
fn metres() {
assert_eq!(PrefixedUnit(0.001, "mm"), prefixed_unit(MetricQuantity {
amount: 0.0001,
unit: Metric::Metre,
@ -208,7 +208,10 @@ mod test {
amount: -1000.0,
unit: Metric::Metre,
}));
}
#[test]
fn grams() {
assert_eq!(PrefixedUnit(1.0, "g"), prefixed_unit(MetricQuantity {
amount: 0.1,
unit: Metric::Gram,
@ -242,7 +245,10 @@ mod test {
amount: -1000.0,
unit: Metric::Gram,
}));
}
#[test]
fn celcius() {
assert_eq!(PrefixedUnit(1.0, "°C"), prefixed_unit(MetricQuantity {
amount: 0.0001,
unit: Metric::Celcius,