diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:08 +0000 |
commit | bab175ec4b075c8076ba14c762900392533f6ee4 (patch) | |
tree | 01f4f29419a2cb10abe13c1e63cd2a66068b0137 /bindings/python/tests/cindex | |
parent | 8b7a8012d223fac5d17d16a66bb39168a9a1dfc0 (diff) |
Notes
Diffstat (limited to 'bindings/python/tests/cindex')
-rw-r--r-- | bindings/python/tests/cindex/test_cursor.py | 2 | ||||
-rw-r--r-- | bindings/python/tests/cindex/test_cursor_kind.py | 3 | ||||
-rw-r--r-- | bindings/python/tests/cindex/test_tokens.py | 2 | ||||
-rw-r--r-- | bindings/python/tests/cindex/test_translation_unit.py | 8 |
4 files changed, 10 insertions, 5 deletions
diff --git a/bindings/python/tests/cindex/test_cursor.py b/bindings/python/tests/cindex/test_cursor.py index 6c8230d4283c4..8103e96df4f9e 100644 --- a/bindings/python/tests/cindex/test_cursor.py +++ b/bindings/python/tests/cindex/test_cursor.py @@ -375,7 +375,7 @@ def test_get_tokens(): foo = get_cursor(tu, 'foo') tokens = list(foo.get_tokens()) - assert len(tokens) == 7 + assert len(tokens) == 6 assert tokens[0].spelling == 'int' assert tokens[1].spelling == 'foo' diff --git a/bindings/python/tests/cindex/test_cursor_kind.py b/bindings/python/tests/cindex/test_cursor_kind.py index 5bac289625be2..4d8d88b92131e 100644 --- a/bindings/python/tests/cindex/test_cursor_kind.py +++ b/bindings/python/tests/cindex/test_cursor_kind.py @@ -42,7 +42,8 @@ def test_kind_groups(): CursorKind.MACRO_DEFINITION, CursorKind.MACRO_INSTANTIATION, CursorKind.INCLUSION_DIRECTIVE, - CursorKind.PREPROCESSING_DIRECTIVE): + CursorKind.PREPROCESSING_DIRECTIVE, + CursorKind.OVERLOAD_CANDIDATE): assert len(group) == 0 else: assert len(group) == 1 diff --git a/bindings/python/tests/cindex/test_tokens.py b/bindings/python/tests/cindex/test_tokens.py index 70748429094ae..688b5c1c900e2 100644 --- a/bindings/python/tests/cindex/test_tokens.py +++ b/bindings/python/tests/cindex/test_tokens.py @@ -14,7 +14,7 @@ def test_token_to_cursor(): r = tu.get_extent('t.c', (0, 9)) tokens = list(tu.get_tokens(extent=r)) - assert len(tokens) == 5 + assert len(tokens) == 4 assert tokens[1].spelling == 'i' assert tokens[1].kind == TokenKind.IDENTIFIER diff --git a/bindings/python/tests/cindex/test_translation_unit.py b/bindings/python/tests/cindex/test_translation_unit.py index be6cd671ae0c0..f959cf4aafcc5 100644 --- a/bindings/python/tests/cindex/test_translation_unit.py +++ b/bindings/python/tests/cindex/test_translation_unit.py @@ -59,9 +59,13 @@ int SOME_DEFINE; assert spellings[-1] == 'y' def test_unsaved_files_2(): - import StringIO + try: + from StringIO import StringIO + except: + from io import StringIO + tu = TranslationUnit.from_source('fake.c', unsaved_files = [ - ('fake.c', StringIO.StringIO('int x;'))]) + ('fake.c', StringIO('int x;'))]) spellings = [c.spelling for c in tu.cursor.get_children()] assert spellings[-1] == 'x' |