summaryrefslogtreecommitdiff
path: root/tests/test_directive_code.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_directive_code.py')
-rw-r--r--tests/test_directive_code.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/test_directive_code.py b/tests/test_directive_code.py
index 8a2283daa..5f0df2b08 100644
--- a/tests/test_directive_code.py
+++ b/tests/test_directive_code.py
@@ -263,7 +263,7 @@ def test_code_block_caption_latex(app, status, warning):
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
caption = '\\sphinxSetupCaptionForVerbatim{caption \\sphinxstyleemphasis{test} rb}'
label = '\\def\\sphinxLiteralBlockLabel{\\label{\\detokenize{caption:id1}}}'
- link = '\hyperref[\\detokenize{caption:name-test-rb}]' \
+ link = '\\hyperref[\\detokenize{caption:name-test-rb}]' \
'{Listing \\ref{\\detokenize{caption:name-test-rb}}}'
assert caption in latex
assert label in latex
@@ -393,9 +393,8 @@ def test_literal_include_lineno_match(app, status, warning):
html = (app.outdir / 'lineno_match.html').text(encoding='utf-8')
pyobject = (
'<td class="linenos"><div class="linenodiv"><pre>'
- ' 9\n'
- '10\n'
- '11</pre></div></td>')
+ '6\n'
+ '7</pre></div></td>')
assert pyobject in html
@@ -419,6 +418,12 @@ def test_literal_include_lineno_match(app, status, warning):
'14</pre></div></td>')
assert start_after in html
+ start_after_with_lines = (
+ '<td class="linenos"><div class="linenodiv"><pre>'
+ '2\n'
+ '3</pre></div></td>')
+ assert start_after_with_lines in html
+
start_at_end_at = (
'<td class="linenos"><div class="linenodiv"><pre>'
' 9\n'
@@ -459,7 +464,7 @@ def test_literalinclude_caption_latex(app, status, warning):
latex = (app.outdir / 'Python.tex').text(encoding='utf-8')
caption = '\\sphinxSetupCaptionForVerbatim{caption \\sphinxstylestrong{test} py}'
label = '\\def\\sphinxLiteralBlockLabel{\\label{\\detokenize{caption:id2}}}'
- link = '\hyperref[\\detokenize{caption:name-test-py}]' \
+ link = '\\hyperref[\\detokenize{caption:name-test-py}]' \
'{Listing \\ref{\\detokenize{caption:name-test-py}}}'
assert caption in latex
assert label in latex