diff options
| author | Tomaz Solc <tomaz.solc@tablix.org> | 2018-12-30 15:31:04 +0100 |
|---|---|---|
| committer | Tomaz Solc <tomaz.solc@tablix.org> | 2018-12-30 15:31:04 +0100 |
| commit | 4b6a097f4ada716639aa1727aaaab64a829a873f (patch) | |
| tree | de522a0e0395d06950cf3f460216ed5c2bf12a4c /tests/test_unidecode.py | |
| parent | e3c730e5830f15c613f65f1764258165f4e5f52f (diff) | |
| download | unidecode-4b6a097f4ada716639aa1727aaaab64a829a873f.tar.gz | |
Check if all spaces are transliterated to spaces.
If x.isspace() is True, then unidecode(x).isspace() should be True as well
(unless it is an empty string)
Diffstat (limited to 'tests/test_unidecode.py')
| -rw-r--r-- | tests/test_unidecode.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_unidecode.py b/tests/test_unidecode.py index 3ae23e9..f33b3ce 100644 --- a/tests/test_unidecode.py +++ b/tests/test_unidecode.py @@ -101,6 +101,15 @@ class BaseTestUnidecode(): wlog.stop() self.assertEqual(0xe000-0xd800, len(wlog.log)) + def test_space(self): + for n in range(0x80, 0x10000): + t = _chr(n) + if t.isspace(): + s = self.unidecode(t) + self.assertTrue((s == '') or s.isspace(), + 'unidecode(%r) should return an empty string or ASCII space, ' + 'since %r.isspace() is true. Instead it returns %r' % (t, t, s)) + @unittest.skipIf(sys.maxunicode < 0x10000, "narrow build") def test_surrogate_pairs(self): # same character, written as a non-BMP character and a |
