File size: 695 Bytes
598316f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | diff --git a/tests/test_number.py b/tests/test_number.py
index 78639c3..c52e1c6 100644
--- a/tests/test_number.py
+++ b/tests/test_number.py
@@ -141,6 +141,14 @@ def test_intword(test_args: list[str], expected: str) -> None:
assert humanize.intword(*test_args) == expected
+def test_intword_accepts_a_scale_separator() -> None:
+ assert humanize.intword(1_200_000, separator="") == "1.2million"
+ assert humanize.intword(-999_999, "%.0f", separator="_") == "-1_million"
+ assert humanize.intword(999, separator="_") == "999"
+ with pytest.raises(TypeError):
+ humanize.intword(1_000, separator=None)
+
+
@pytest.mark.parametrize(
"test_input, expected",
[
|