summaryrefslogtreecommitdiffstats
path: root/bindings/python/tests
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-01-25 09:16:41 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-01-25 09:16:41 +0000
commitdb59a7700e5e42e8b5f6f8e327067a969540ee14 (patch)
tree3bc069962a009cb65d2890d5e08dcc093446107e /bindings/python/tests
parent326be568e2cb04285c84e6e26a3e6b3822607361 (diff)
cindex/Python: Support file objects as unsaved_files, albeit inefficiently.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94418 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/tests')
-rw-r--r--bindings/python/tests/cindex/test_translation_unit.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bindings/python/tests/cindex/test_translation_unit.py b/bindings/python/tests/cindex/test_translation_unit.py
index 9cf7aba3bb..ec12e689d9 100644
--- a/bindings/python/tests/cindex/test_translation_unit.py
+++ b/bindings/python/tests/cindex/test_translation_unit.py
@@ -41,3 +41,11 @@ int SOME_DEFINE;
spellings = [c.spelling for c in tu.cursor.get_children()]
assert spellings[-2] == 'x'
assert spellings[-1] == 'y'
+
+def test_unsaved_files_2():
+ import StringIO
+ index = Index.create()
+ tu = index.parse('fake.c', unsaved_files = [
+ ('fake.c', StringIO.StringIO('int x;'))])
+ spellings = [c.spelling for c in tu.cursor.get_children()]
+ assert spellings[-1] == 'x'