RedinGhost's picture
Publish curated reproducibility artifact
598316f verified
Raw
History Blame Contribute Delete
686 Bytes
diff --git a/tests/test_number.py b/tests/test_number.py
index 78639c3..a609650 100644
--- a/tests/test_number.py
+++ b/tests/test_number.py
@@ -315,3 +315,10 @@ def test_clamp(test_args: list[typing.Any], expected: str) -> None:
)
def test_metric(test_args: list[typing.Any], expected: str) -> None:
assert humanize.metric(*test_args) == expected
+
+
+def test_metric_can_render_an_ascii_micro_prefix() -> None:
+ assert humanize.metric(220e-6, "F", ascii_only=True) == "220 uF"
+ assert humanize.metric(-1.5e-6, "s", ascii_only=True) == "-1.50 us"
+ assert humanize.metric(2e-3, "V", ascii_only=True) == "2.00 mV"
+ assert humanize.metric(220e-6, "F") == "220 μF"