summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_codecencodings_cn.py
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2017-05-22 14:42:05 (GMT)
committerGitHub <noreply@github.com>2017-05-22 14:42:05 (GMT)
commit89a5e03244370f41ce9bed5cea38e0dd620edb73 (patch)
tree604c02dcee1283840d77863004af88397654ccfe /Lib/test/test_codecencodings_cn.py
parent15033d145b77207cea82267aa2fe5f1c2b71d3bd (diff)
downloadcpython-89a5e03244370f41ce9bed5cea38e0dd620edb73.zip
cpython-89a5e03244370f41ce9bed5cea38e0dd620edb73.tar.gz
cpython-89a5e03244370f41ce9bed5cea38e0dd620edb73.tar.bz2
bpo-30003: Fix handling escape characters in HZ codec (#1556)
Diffstat (limited to 'Lib/test/test_codecencodings_cn.py')
-rw-r--r--Lib/test/test_codecencodings_cn.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_codecencodings_cn.py b/Lib/test/test_codecencodings_cn.py
index c8a410c..2a45071 100644
--- a/Lib/test/test_codecencodings_cn.py
+++ b/Lib/test/test_codecencodings_cn.py
@@ -86,6 +86,10 @@ class Test_HZ(multibytecodec_support.TestBase, unittest.TestCase):
(b'ab~{\x81\x81\x41\x44~}cd', 'replace', 'ab\uFFFD\uFFFD\u804Acd'),
(b'ab~{\x41\x44~}cd', 'replace', 'ab\u804Acd'),
(b"ab~{\x79\x79\x41\x44~}cd", "replace", "ab\ufffd\ufffd\u804acd"),
+ # issue 30003
+ ('ab~cd', 'strict', b'ab~~cd'), # escape ~
+ (b'~{Dc~~:C~}', 'strict', None), # ~~ only in ASCII mode
+ (b'~{Dc~\n:C~}', 'strict', None), # ~\n only in ASCII mode
)
if __name__ == "__main__":