Fix #6742: end-before option of literalinclude skips first line

This commit is contained in:
Takeshi KOMIYA committed 2019-10-28 19:16:20 +09:00
1 parent ec8d41b237
commit 39b166b6b9
3 files changed
+12 -1

No files matched your search

+8
View File
@@ -206,6 +206,14 @@ def test_LiteralIncludeReader_missing_start_and_end(literal_inc_path):
content, lines = reader.read()
def test_LiteralIncludeReader_end_before(literal_inc_path):
options = {'end-before': 'nclud'} # *nclud* matches first and third lines.
reader = LiteralIncludeReader(literal_inc_path, options, DUMMY_CONFIG)
content, lines = reader.read()
assert content == ("# Literally included file using Python highlighting\n"
"\n")
@pytest.mark.xfail(os.name != 'posix', reason="Not working on windows")
def test_LiteralIncludeReader_prepend(literal_inc_path):
options = {'lines': '1', 'prepend': 'Hello', 'append': 'Sphinx'}