77
88import unittest
99
10- kInputsDir = os .path .join (os .path .dirname (__file__ ), "INPUTS" )
10+ inputs_dir = os .path .join (os .path .dirname (__file__ ), "INPUTS" )
1111
1212class 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
0 commit comments