diff options
author | shimizukawa <shimizukawa@gmail.com> | 2013-02-06 00:29:59 +0900 |
---|---|---|
committer | shimizukawa <shimizukawa@gmail.com> | 2013-02-06 00:29:59 +0900 |
commit | 9bd8c2371bf682cb420d8fa0435e77e641b3530b (patch) | |
tree | 6d2803620de86da708531572db3606d24ba0eacc /tests/test_build_text.py | |
parent | 32a005fe1a5d16c6005e5d2dc14183b25583aa6b (diff) | |
download | sphinx-9bd8c2371bf682cb420d8fa0435e77e641b3530b.tar.gz |
Fix text builder did not respect wide/fullwidth charactors for table layout.
Diffstat (limited to 'tests/test_build_text.py')
-rw-r--r-- | tests/test_build_text.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_build_text.py b/tests/test_build_text.py index d0472b8f..63df8ee0 100644 --- a/tests/test_build_text.py +++ b/tests/test_build_text.py @@ -42,3 +42,24 @@ def test_multibyte_title_line(app): expect_underline = underline.replace('=', '*') result_underline = result.splitlines()[2].strip() assert expect_underline == result_underline + + +@with_text_app() +def test_multibyte_table(app): + text = u'\u65e5\u672c\u8a9e' + contents = (u"\n.. list-table::" + "\n" + "\n - - spam" + "\n - egg" + "\n" + "\n - - %(text)s" + "\n - %(text)s" + "\n" % locals()) + + (app.srcdir / 'contents.rst').write_text(contents, encoding='utf-8') + app.builder.build_all() + result = (app.outdir / 'contents.txt').text(encoding='utf-8') + + lines = [line.strip() for line in result.splitlines() if line.strip()] + line_widths = [column_width(line) for line in lines] + assert len(set(line_widths)) == 1 # same widths |