summaryrefslogtreecommitdiff
path: root/tests/test_ext_math.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-04-27 21:47:20 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-04-27 21:47:20 +0900
commita252954ea34c6fb176d9f5d7d28285e62b27ec84 (patch)
tree026300a5cf81ccc0576a28304ec9db0c628234fe /tests/test_ext_math.py
parent4874ae2c1d85df2666c9e3b52bd105599c0acc12 (diff)
downloadsphinx-git-a252954ea34c6fb176d9f5d7d28285e62b27ec84.tar.gz
Fix #3638: Allow to change a label of reference to equation
Diffstat (limited to 'tests/test_ext_math.py')
-rw-r--r--tests/test_ext_math.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_ext_math.py b/tests/test_ext_math.py
index 296bba94f..82894974f 100644
--- a/tests/test_ext_math.py
+++ b/tests/test_ext_math.py
@@ -117,3 +117,26 @@ def test_math_number_all_latex(app, status, warning):
macro = r'Referencing equation \\eqref{equation:math:foo}.'
assert re.search(macro, content, re.S)
+
+
+@pytest.mark.sphinx('html', testroot='ext-math',
+ confoverrides={'extensions': ['sphinx.ext.mathjax'],
+ 'math_eqref_format': 'Eq.{number}'})
+def test_math_eqref_format_html(app, status, warning):
+ app.builder.build_all()
+
+ content = (app.outdir / 'math.html').text()
+ html = ('<p>Referencing equation <a class="reference internal" '
+ 'href="#equation-foo">Eq.1</a>.</p>')
+ assert html in content
+
+
+@pytest.mark.sphinx('latex', testroot='ext-math',
+ confoverrides={'extensions': ['sphinx.ext.mathjax'],
+ 'math_eqref_format': 'Eq.{number}'})
+def test_math_eqref_format_latex(app, status, warning):
+ app.builder.build_all()
+
+ content = (app.outdir / 'test.tex').text()
+ macro = r'Referencing equation Eq.\\ref{equation:math:foo}.'
+ assert re.search(macro, content, re.S)