Skip to content

Commit 3b7e29b

Browse files
committed
Python: add test for crosstalk
1 parent 6831775 commit 3b7e29b

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
| test_crosstalk.py:8:16:8:18 | ControlFlowNode for f() | bar |
2+
| test_crosstalk.py:8:16:8:18 | ControlFlowNode for f() | baz |
3+
| test_crosstalk.py:13:16:13:18 | ControlFlowNode for g() | bar |
4+
| test_crosstalk.py:13:16:13:18 | ControlFlowNode for g() | baz |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
def outer():
3+
from foo import bar, baz
4+
5+
def inner_bar():
6+
f = bar
7+
g = baz
8+
return f()
9+
10+
def inner_baz():
11+
f = bar
12+
g = baz
13+
return g()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import python
2+
import semmle.python.ApiGraphs
3+
4+
from API::CallNode callNode, string member
5+
where
6+
callNode = API::moduleImport("foo").getMember(member).getACall() and
7+
callNode.getLocation().getFile().getBaseName() = "test_crosstalk.py"
8+
select callNode, member

0 commit comments

Comments
 (0)