Skip to content
This repository has been archived by the owner on Oct 13, 2021. It is now read-only.

Commit

Permalink
Move test_sig_needles() into test_needles.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrose committed Feb 9, 2016
1 parent 04507c8 commit 22988bd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 1 addition & 14 deletions dxr/plugins/clang/tests/test_clang.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@

from nose.tools import eq_

from dxr.indexers import Extent, Position, FuncSig
from dxr.indexers import Extent, Position
from dxr.plugins.clang.condense import condense, process_call, process_function
from dxr.plugins.clang.needles import sig_needles


DEFAULT_EXTENT = Extent(start=Position(0, 0), end=Position(0, 0))
DISPATCH_TABLE = {'call': process_call,
'function': process_function}

Expand All @@ -29,17 +27,6 @@ def test_smoke_test_csv():
condense_csv('')


def test_sig_needles():
fixture = {
'function': [{'type': FuncSig(('int**', 'int', 'int'), 'int**'),
'span': DEFAULT_EXTENT}],
'variable': [{'type': 'a',
'span': DEFAULT_EXTENT}],
}
eq_(list(sig_needles(fixture)),
[(('c-sig', '(int**, int, int) -> int**'), DEFAULT_EXTENT)])


def test_duplicate_collapsing():
"""Duplicate condensed data should be filtered out.
Expand Down
15 changes: 14 additions & 1 deletion dxr/plugins/clang/tests/test_needles.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
from nose.tools import eq_

from dxr.plugins.clang.needles import _walk_graph
from dxr.indexers import Extent, Position, FuncSig
from dxr.plugins.clang.needles import _walk_graph, sig_needles


def test_sig_needles():
dummy_extent = Extent(start=Position(0, 0), end=Position(0, 0))
fixture = {
'function': [{'type': FuncSig(('int**', 'int', 'int'), 'int**'),
'span': dummy_extent}],
'variable': [{'type': 'a',
'span': dummy_extent}],
}
eq_(list(sig_needles(fixture)),
[(('c-sig', '(int**, int, int) -> int**'), dummy_extent)])


def test_graph_walking_cycles():
Expand Down

0 comments on commit 22988bd

Please sign in to comment.