diff --git a/tests/test_chinese.py b/tests/test_chinese.py index 83e2d70..4bde6c2 100644 --- a/tests/test_chinese.py +++ b/tests/test_chinese.py @@ -1,4 +1,4 @@ -from wordfreq import tokenize, word_frequency +from wordfreq import tokenize, word_frequency, zipf_frequency import pytest @@ -80,8 +80,10 @@ def test_alternate_codes(): def test_unreasonably_long(): - # This crashed earlier versions of wordfreq + # This crashed earlier versions of wordfreq due to an overflow in + # exponentiation. We've now changed the sequence of operations so it + # will underflow instead. lots_of_ls = 'l' * 800 - assert word_frequency(lots_of_ls, 'zh') < 1e-300 + assert word_frequency(lots_of_ls, 'zh') == 0. assert zipf_frequency(lots_of_ls, 'zh') == 0.