# HG changeset patch # User Augie Fackler # Date 2019-01-24 19:12:00 # Node ID 24bef6a99958af2776fdecbb3f96a29a06e27d5e # Parent 6dadf3f46661c451edbc781da5357846f57954b5 py3: fix up test-encoding-align.t for python3 I'm not super thrilled with how this reads, but the original didn't thrill me either. Differential Revision: https://phab.mercurial-scm.org/D5682 diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist --- a/contrib/python3-whitelist +++ b/contrib/python3-whitelist @@ -165,6 +165,7 @@ test-empty-file.t test-empty-group.t test-empty.t test-encode.t +test-encoding-align.t test-encoding-func.py test-encoding-textwrap.t test-encoding.t diff --git a/tests/test-encoding-align.t b/tests/test-encoding-align.t --- a/tests/test-encoding-align.t +++ b/tests/test-encoding-align.t @@ -5,6 +5,7 @@ Test alignment of multibyte characters $ hg init t $ cd t $ "$PYTHON" << EOF + > from mercurial import pycompat > # (byte, width) = (6, 4) > s = b"\xe7\x9f\xad\xe5\x90\x8d" > # (byte, width) = (7, 7): odd width is good for alignment test @@ -21,14 +22,17 @@ Test alignment of multibyte characters > command = registrar.command(cmdtable) > > @command(b'showoptlist', - > [('s', 'opt1', '', 'short width' + ' %(s)s' * 8, '%(s)s'), - > ('m', 'opt2', '', 'middle width' + ' %(m)s' * 8, '%(m)s'), - > ('l', 'opt3', '', 'long width' + ' %(l)s' * 8, '%(l)s')], - > '') + > [(b's', b'opt1', b'', b'short width' + (b' ' +%(s)s) * 8, %(s)s), + > (b'm', b'opt2', b'', b'middle width' + (b' ' + %(m)s) * 8, %(m)s), + > (b'l', b'opt3', b'', b'long width' + (b' ' + %(l)s) * 8, %(l)s)], + > b'') > def showoptlist(ui, repo, *pats, **opts): > '''dummy command to show option descriptions''' > return 0 - > """ % globals()) + > """ % {b's': pycompat.byterepr(s), + > b'm': pycompat.byterepr(m), + > b'l': pycompat.byterepr(l), + > }) > f.close() > EOF $ S=`cat s`