def test_ascii(): _in = "Bacon ipsum dolor sit amet" _out = ["Bacon", "ipsum", "dolor sit", "amet"] assert _minimize(_in, delim, Lmax) == _out
def test_unicode(): _in = "这是一个三岁的小孩在讲述他从一系列照片里看到的东西。" _out = ["这是一个三岁的小孩在", "讲述他从一系列照片里", "看到的东西。"] assert _minimize(_in, delim, Lmax) == _out
def test_startwith_delim(): _in = delim + "test" _out = ["test"] assert _minimize(_in, delim, Lmax) == _out
def test_ascii_no_delim(): _in = "Baconipsumdolorsitametflankcornedbee" _out = ["Baconipsum", "dolorsitam", "etflankcor", "nedbee"] assert _minimize(_in, delim, Lmax) == _out