summaryrefslogtreecommitdiff
path: root/tests/test_io.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2017-12-13 20:49:50 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2017-12-13 20:49:50 +0900
commit6dae5db9af55807de1db4067203e57dabb6ed774 (patch)
treef0b78af8766256130628bc9cd1ce97e8ce9937fb /tests/test_io.py
parent07c5348a56471201b5901881b0d9d83f4823a6fd (diff)
downloadsphinx-git-6dae5db9af55807de1db4067203e57dabb6ed774.tar.gz
Fix SphinxRSTFileInput should expand tabs
Diffstat (limited to 'tests/test_io.py')
-rw-r--r--tests/test_io.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_io.py b/tests/test_io.py
index a017a2cc0..ecd4a1009 100644
--- a/tests/test_io.py
+++ b/tests/test_io.py
@@ -105,3 +105,14 @@ def test_SphinxRSTFileInput(app):
assert result.info(3) == ('<rst_epilog>', 0)
assert result.info(4) == ('<rst_epilog>', 1)
assert result.info(5) == ('<rst_epilog>', None) # out of range
+
+ # expandtabs / convert whitespaces
+ app.env.config.rst_prolog = None
+ app.env.config.rst_epilog = None
+ text = ('\thello Sphinx world\n'
+ '\v\fSphinx is a document generator')
+ source = SphinxRSTFileInput(app, app.env, source=StringIO(text),
+ source_path='dummy.rst', encoding='utf-8')
+ result = source.read()
+ assert result.data == [' hello Sphinx world',
+ ' Sphinx is a document generator']