minix/external/bsd/llvm/dist/clang/bindings/python/tests/cindex/test_file.py

10 lines
265 B
Python

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>"