Skip to content

Commit b8a4f30

Browse files
committed
Adress review comments
1 parent d2fcbda commit b8a4f30

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

clang/bindings/python/tests/cindex/test_file.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import unittest
99

10-
kInputsDir = os.path.join(os.path.dirname(__file__), "INPUTS")
10+
inputs_dir = os.path.join(os.path.dirname(__file__), "INPUTS")
1111

1212
class TestFile(unittest.TestCase):
1313
def test_file(self):
@@ -19,8 +19,8 @@ def test_file(self):
1919
self.assertEqual(repr(file), "<File: t.c>")
2020

2121
def test_file_eq(self):
22-
path = os.path.join(kInputsDir, "hello.cpp")
23-
header_path = os.path.join(kInputsDir, "header3.h")
22+
path = os.path.join(inputs_dir, "hello.cpp")
23+
header_path = os.path.join(inputs_dir, "header3.h")
2424
tu = TranslationUnit.from_source(path)
2525
file1 = File.from_name(tu, path)
2626
file2 = File.from_name(tu, header_path)
@@ -30,3 +30,17 @@ def test_file_eq(self):
3030
self.assertEqual(file2, file2_2)
3131
self.assertNotEqual(file1, file2)
3232
self.assertNotEqual(file1, "t.c")
33+
34+
# FIXME: this test shouldn't pass
35+
def test_file_eq_failing(self):
36+
index = Index.create()
37+
tu = index.parse(
38+
"t.c",
39+
unsaved_files=[
40+
("t.c", "int a = 729;"),
41+
("s.c", "int a = 729;"),
42+
],
43+
)
44+
file1 = File.from_name(tu, "t.c")
45+
file2 = File.from_name(tu, "s.c")
46+
self.assertEqual(file1, file2) # These files are not supposed to be equal

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ Python Binding Changes
527527
----------------------
528528
- Added ``Type.get_methods``, a binding for ``clang_visitCXXMethods``, which
529529
allows visiting the methods of a class.
530-
- Add equality comparison operators for ``File`` type
530+
- Add equality comparison operators for ``File`` type.
531531

532532
OpenMP Support
533533
--------------

0 commit comments

Comments
 (0)