mirror of
https://github.com/python/cpython.git
synced 2025-10-17 12:18:23 +00:00
gh-104400: Add more tests to pygettext (GH-108173)
This commit is contained in:
parent
556dc9b8a7
commit
dcae5cd6ab
8 changed files with 363 additions and 21 deletions
26
Lib/test/test_tools/i18n_data/fileloc.py
Normal file
26
Lib/test/test_tools/i18n_data/fileloc.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Test file locations
|
||||
from gettext import gettext as _
|
||||
|
||||
# Duplicate strings
|
||||
_('foo')
|
||||
_('foo')
|
||||
|
||||
# Duplicate strings on the same line should only add one location to the output
|
||||
_('bar'), _('bar')
|
||||
|
||||
|
||||
# Duplicate docstrings
|
||||
class A:
|
||||
"""docstring"""
|
||||
|
||||
|
||||
def f():
|
||||
"""docstring"""
|
||||
|
||||
|
||||
# Duplicate message and docstring
|
||||
_('baz')
|
||||
|
||||
|
||||
def g():
|
||||
"""baz"""
|
Loading…
Add table
Add a link
Reference in a new issue