Skip to content

Commit affca1a

Browse files
committed
Python: Add test-cases using keyword arguments for builtin function
1 parent dfe7c82 commit affca1a

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

python/ql/test/library-tests/PointsTo/calls/CallPointsTo.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
| 40 | ControlFlowNode for f() | Function f |
1414
| 41 | ControlFlowNode for C() | class C |
1515
| 42 | ControlFlowNode for Attribute() | Method(Function C.n, C()) |
16+
| 45 | ControlFlowNode for open() | Builtin-function open |
17+
| 46 | ControlFlowNode for open() | Builtin-function open |

python/ql/test/library-tests/PointsTo/calls/GetACall.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@
1717
| 41 | ControlFlowNode for C() | class C |
1818
| 42 | ControlFlowNode for Attribute() | Function C.n |
1919
| 42 | ControlFlowNode for Attribute() | Method(Function C.n, C()) |
20+
| 45 | ControlFlowNode for open() | Builtin-function open |
21+
| 46 | ControlFlowNode for open() | Builtin-function open |

python/ql/test/library-tests/PointsTo/calls/getArgumentForCall.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@
2626
| 42 | ControlFlowNode for Attribute() | Function C.n | 0 | ControlFlowNode for c |
2727
| 42 | ControlFlowNode for Attribute() | Function C.n | 1 | ControlFlowNode for IntegerLiteral |
2828
| 42 | ControlFlowNode for Attribute() | Method(Function C.n, C()) | 0 | ControlFlowNode for IntegerLiteral |
29+
| 45 | ControlFlowNode for open() | Builtin-function open | 0 | ControlFlowNode for Str |
30+
| 45 | ControlFlowNode for open() | Builtin-function open | 1 | ControlFlowNode for Str |

python/ql/test/library-tests/PointsTo/calls/test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ def foo(arg):
4040
f(arg0=0, arg1=1, arg2=2)
4141
c = C()
4242
c.n(arg1=1)
43+
44+
# positional/keyword arguments for a builtin function
45+
open("foo.txt", "rb") # TODO: Not handled by getNamedArgumentForCall
46+
open(file="foo.txt", mode="rb") # TODO: Not handled by either getNamedArgumentForCall or getArgumentForCall

0 commit comments

Comments
 (0)