mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 23:38:50 +03:00
doctest: replace chr() with pycompat.bytechr()
This commit is contained in:
parent
b8768dba29
commit
0435ef1b07
@ -27,6 +27,7 @@ _defaultextra = {'branch': 'default'}
|
||||
|
||||
def _string_escape(text):
|
||||
"""
|
||||
>>> from .pycompat import bytechr as chr
|
||||
>>> d = {b'nl': chr(10), b'bs': chr(92), b'cr': chr(13), b'nul': chr(0)}
|
||||
>>> s = b"ab%(nl)scd%(bs)s%(bs)sn%(nul)sab%(cr)scd%(bs)s%(nl)s" % d
|
||||
>>> s
|
||||
@ -41,6 +42,7 @@ def _string_escape(text):
|
||||
|
||||
def decodeextra(text):
|
||||
"""
|
||||
>>> from .pycompat import bytechr as chr
|
||||
>>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'})
|
||||
... ).items())
|
||||
[('baz', '\\x002'), ('branch', 'default'), ('foo', 'bar')]
|
||||
|
Loading…
Reference in New Issue
Block a user