7
7
8
8
import unittest
9
9
10
- kInputsDir = os .path .join (os .path .dirname (__file__ ), "INPUTS" )
10
+ inputs_dir = os .path .join (os .path .dirname (__file__ ), "INPUTS" )
11
11
12
12
class TestFile (unittest .TestCase ):
13
13
def test_file (self ):
@@ -19,8 +19,8 @@ def test_file(self):
19
19
self .assertEqual (repr (file ), "<File: t.c>" )
20
20
21
21
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" )
24
24
tu = TranslationUnit .from_source (path )
25
25
file1 = File .from_name (tu , path )
26
26
file2 = File .from_name (tu , header_path )
@@ -30,3 +30,17 @@ def test_file_eq(self):
30
30
self .assertEqual (file2 , file2_2 )
31
31
self .assertNotEqual (file1 , file2 )
32
32
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