summaryrefslogtreecommitdiff
path: root/clang/bindings/python/tests/cindex/test_file.py
blob: 146e8c570528702222bd828f3ac3fe48ce079f13 (about) (plain)
1
2
3
4
5
6
7
8
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>"