Skip to content

Commit

Permalink
Add test for sphinx-doc#4066 latex \index indent fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbu committed Sep 20, 2017
1 parent 444b199 commit d0418f9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/roots/test-latex-index/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

master_doc = 'index'
12 changes: 12 additions & 0 deletions tests/roots/test-latex-index/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
test-latex-index
================

A :index:`famous` :index:`equation`:

.. math::
E = m c^2
.. index:: Einstein, relativity

and some text.
9 changes: 9 additions & 0 deletions tests/test_build_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,3 +1020,12 @@ def test_latex_remote_images(app, status, warning):
assert '\\sphinxincludegraphics{{NOT_EXIST}.PNG}' not in result
assert ('WARNING: Could not fetch remote image: '
'http://example.com/NOT_EXIST.PNG [404]' in warning.getvalue())


@pytest.mark.sphinx('latex', testroot='latex-index')
def test_latex_index(app, status, warning):
app.builder.build_all()

result = (app.outdir / 'Python.tex').text(encoding='utf8')
assert 'A \\index{famous}famous \\index{equation}equation:\n' in result
assert '\n\\index{Einstein}\\index{relativity}\\ignorespaces \nand' in result

0 comments on commit d0418f9

Please sign in to comment.