summaryrefslogtreecommitdiffstats
path: root/bindings/python/tests
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2011-10-31 00:07:19 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2011-10-31 00:07:19 +0000
commita9ea5df14abb807eb0173e2737c5a1d61e86975b (patch)
tree62701988e18bacf57dca147610376fb1731c2f5a /bindings/python/tests
parent7993e8a2a26bf408c2a6d45f24fffa12db336b2b (diff)
cindex.py: Add File.create_from_name()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/tests')
-rw-r--r--bindings/python/tests/cindex/test_file.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/bindings/python/tests/cindex/test_file.py b/bindings/python/tests/cindex/test_file.py
new file mode 100644
index 0000000000..146e8c5705
--- /dev/null
+++ b/bindings/python/tests/cindex/test_file.py
@@ -0,0 +1,9 @@
+from clang.cindex import Index, File
+
+def test_file():
+ index = Index.create()
+ tu = index.parse('t.c', unsaved_files = [('t.c', "")])
+ file = File.from_name(tu, "t.c")
+ assert str(file) == "t.c"
+ assert file.name == "t.c"
+ assert repr(file) == "<File: t.c>"