summaryrefslogtreecommitdiffstats
path: root/bindings/python/tests/cindex/test_translation_unit.py
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/python/tests/cindex/test_translation_unit.py')
-rw-r--r--bindings/python/tests/cindex/test_translation_unit.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/bindings/python/tests/cindex/test_translation_unit.py b/bindings/python/tests/cindex/test_translation_unit.py
index 3c05c3f..f130db6 100644
--- a/bindings/python/tests/cindex/test_translation_unit.py
+++ b/bindings/python/tests/cindex/test_translation_unit.py
@@ -25,16 +25,24 @@ def test_parse_arguments():
assert spellings[-2] == 'hello'
assert spellings[-1] == 'hi'
+def test_reparse_arguments():
+ path = os.path.join(kInputsDir, 'parse_arguments.c')
+ index = Index.create()
+ tu = index.parse(path, ['-DDECL_ONE=hello', '-DDECL_TWO=hi'])
+ tu.reparse()
+ spellings = [c.spelling for c in tu.cursor.get_children()]
+ assert spellings[-2] == 'hello'
+ assert spellings[-1] == 'hi'
+
def test_unsaved_files():
index = Index.create()
- # FIXME: Why can't we just use "fake.h" here (instead of /tmp/fake.h)?
- tu = index.parse('fake.c', unsaved_files = [
+ tu = index.parse('fake.c', ['-I./'], unsaved_files = [
('fake.c', """
-#include "/tmp/fake.h"
+#include "fake.h"
int x;
int SOME_DEFINE;
"""),
- ('/tmp/fake.h', """
+ ('./fake.h', """
#define SOME_DEFINE y
""")
])
OpenPOWER on IntegriCloud