Mercurial > hg
comparison tests/test-help.t @ 40250:7759c26a3a0b
py3: do I/O in bytes in test-help.t
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 13 Oct 2018 14:11:12 +0200 |
parents | 6e7789064c21 |
children | c303d65d2e34 |
comparison
equal
deleted
inserted
replaced
40249:c9e8c93e241c | 40250:7759c26a3a0b |
---|---|
1797 This tests that section lookup by translated string isn't broken by | 1797 This tests that section lookup by translated string isn't broken by |
1798 such str.lower(). | 1798 such str.lower(). |
1799 | 1799 |
1800 $ "$PYTHON" <<EOF | 1800 $ "$PYTHON" <<EOF |
1801 > def escape(s): | 1801 > def escape(s): |
1802 > return ''.join('\u%x' % ord(uc) for uc in s.decode('cp932')) | 1802 > return b''.join(b'\\u%x' % ord(uc) for uc in s.decode('cp932')) |
1803 > # translation of "record" in ja_JP.cp932 | 1803 > # translation of "record" in ja_JP.cp932 |
1804 > upper = "\x8bL\x98^" | 1804 > upper = b"\x8bL\x98^" |
1805 > # str.lower()-ed section name should be treated as different one | 1805 > # str.lower()-ed section name should be treated as different one |
1806 > lower = "\x8bl\x98^" | 1806 > lower = b"\x8bl\x98^" |
1807 > with open('ambiguous.py', 'w') as fp: | 1807 > with open('ambiguous.py', 'wb') as fp: |
1808 > fp.write("""# ambiguous section names in ja_JP.cp932 | 1808 > fp.write(b"""# ambiguous section names in ja_JP.cp932 |
1809 > u'''summary of extension | 1809 > u'''summary of extension |
1810 > | 1810 > |
1811 > %s | 1811 > %s |
1812 > ---- | 1812 > ---- |
1813 > | 1813 > |
1830 > [extensions] | 1830 > [extensions] |
1831 > ambiguous = ./ambiguous.py | 1831 > ambiguous = ./ambiguous.py |
1832 > EOF | 1832 > EOF |
1833 | 1833 |
1834 $ "$PYTHON" <<EOF | sh | 1834 $ "$PYTHON" <<EOF | sh |
1835 > upper = "\x8bL\x98^" | 1835 > from mercurial import pycompat |
1836 > print("hg --encoding cp932 help -e ambiguous.%s" % upper) | 1836 > upper = b"\x8bL\x98^" |
1837 > pycompat.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % upper) | |
1837 > EOF | 1838 > EOF |
1838 \x8bL\x98^ (esc) | 1839 \x8bL\x98^ (esc) |
1839 ---- | 1840 ---- |
1840 | 1841 |
1841 Upper name should show only this message | 1842 Upper name should show only this message |
1842 | 1843 |
1843 | 1844 |
1844 $ "$PYTHON" <<EOF | sh | 1845 $ "$PYTHON" <<EOF | sh |
1845 > lower = "\x8bl\x98^" | 1846 > from mercurial import pycompat |
1846 > print("hg --encoding cp932 help -e ambiguous.%s" % lower) | 1847 > lower = b"\x8bl\x98^" |
1848 > pycompat.stdout.write(b"hg --encoding cp932 help -e ambiguous.%s\n" % lower) | |
1847 > EOF | 1849 > EOF |
1848 \x8bl\x98^ (esc) | 1850 \x8bl\x98^ (esc) |
1849 ---- | 1851 ---- |
1850 | 1852 |
1851 Lower name should show only this message | 1853 Lower name should show only this message |