[PATCH 3/9] Add tests for handling tabs inside literal block ``::``

"Jarret \"Jax\" Renker via Docutils-develop" <[email protected]>
Newsgroups gmane.text.docutils.devel
Message-ID <yaT1wBxkE2R-Q0yW0MCfXCVGbPt6X6f8ojGzMlPy1GjRIuYWQAf475JJtgULGLGzWGYuqpK7ANmY3E4zSiDHf2jv7NMhQYGkoa5MLko1R8o=@proton.me>
---
 .../test_rst/test_literal_blocks.py           | 59 +++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/docutils/test/test_parsers/test_rst/test_literal_blocks.py b/docutils/test/test_parsers/test_rst/test_literal_blocks.py
index 95dd6a79f..123c35b11 100755
--- a/docutils/test/test_parsers/test_rst/test_literal_blocks.py
+++ b/docutils/test/test_parsers/test_rst/test_literal_blocks.py
@@ -384,6 +384,65 @@ def test_parser(self):
 """],
 ]
 
+totest['literal_blocks_with_tabs'] = [
+["""\
+A literal block with an indented tab::
+
+    A literal block.
+    \t<-- with a tab
+""",
+"""\
+<document source="test data">
+    <paragraph>
+        A literal block with an indented tab:
+    <literal_block xml:space="preserve">
+        A literal block.
+        \t<-- with a tab
+"""],
+["""\
+A literal block with a non-indented tab::
+
+    A literal block.
+\t<-- with a tab
+""",
+"""\
+<document source="test data">
+    <paragraph>
+        A literal block with a non-indented tab:
+    <literal_block xml:space="preserve">
+        A literal block.
+            <-- with a tab
+"""],
+["""\
+A literal block with an indented tab first::
+
+    \t<-- with a tab
+    A literal block.
+""",
+"""\
+<document source="test data">
+    <paragraph>
+        A literal block with an indented tab first:
+    <literal_block xml:space="preserve">
+        \t<-- with a tab
+        A literal block.
+"""],
+["""\
+A literal block with a non-indented tab first::
+
+\t<-- with a tab
+    A literal block.
+""",
+"""\
+<document source="test data">
+    <paragraph>
+        A literal block with a non-indented tab first:
+    <literal_block xml:space="preserve">
+            <-- with a tab
+        A literal block.
+"""],
+]
+
 
 if __name__ == '__main__':
     unittest.main()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.