test_file.py 265 B

123456789
  1. from clang.cindex import Index, File
  2. def test_file():
  3. index = Index.create()
  4. tu = index.parse('t.c', unsaved_files = [('t.c', "")])
  5. file = File.from_name(tu, "t.c")
  6. assert str(file) == "t.c"
  7. assert file.name == "t.c"
  8. assert repr(file) == "<File: t.c>"