Skip to content

Commit

Permalink
doctests(expansion): Add test for _expand_kRSGeneric()
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Dec 10, 2023
1 parent 35518a1 commit 4cfe93b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/unihan_etl/expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,14 @@ class kRSGenericDict(t.TypedDict):


def _expand_kRSGeneric(value: t.List[str]) -> t.List[kRSGenericDict]:
"""Expand kRSGeneric field."""
"""Expand kRSGeneric field.
Examples
--------
>>> _expand_kRSGeneric(['5.10', "213''.0"]) # doctest: +NORMALIZE_WHITESPACE
[{'radical': 5, 'strokes': 10, 'simplified': False},
{'radical': 213, 'strokes': 0, 'simplified': False}]
"""
pattern = re.compile(
r"""
(?P<radical>[1-9][0-9]{0,2})
Expand Down

0 comments on commit 4cfe93b

Please sign in to comment.