From d6441454fc037172ac054dc833bec0b079533fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 29 May 2023 02:54:27 +0300 Subject: [PATCH] Split format::test::units to per-unit tests --- src/format.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/format.rs b/src/format.rs index 25e3def..f0039f3 100644 --- a/src/format.rs +++ b/src/format.rs @@ -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,