Skip to content

Commit f215bef

Browse files
author
Park Hyunwoo
committed
Add a non-Korean test for Formatter
1 parent 46c9c95 commit f215bef

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,10 @@ def test_formatter():
378378
assert f1(u'모리안') == f2(u'모리안') == u'모리안으로 모리안을'
379379

380380

381+
def test_formatter_without_korean():
382+
assert tossi.format('{0}', u'Tossi') == u'Tossi'
383+
384+
381385
def test_singleton_error():
382386
with pytest.raises(TypeError):
383387
class Fail(with_metaclass(SingletonParticleMeta, object)):

tossi/coda.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ def filter_only_significant(word):
7171
x = len(word)
7272
while x > 0:
7373
x -= 1
74-
l = word[x]
74+
c = word[x]
7575
# Skip a complete parenthesis.
76-
if l == u')':
76+
if c == u')':
7777
m = INSIGNIFICANT_PARENTHESIS_PATTERN.search(word[:x + 1])
7878
if m is not None:
7979
x = m.start()
8080
continue
8181
# Skip unreadable characters such as punctuations.
82-
unicode_category = unicodedata.category(l)
82+
unicode_category = unicodedata.category(c)
8383
if not SIGNIFICANT_UNICODE_CATEGORY_PATTERN.match(unicode_category):
8484
continue
8585
break

0 commit comments

Comments
 (0)