Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit aef592f

Browse files
committed
make a more realistic test for self-parameter
1 parent 55ffdb4 commit aef592f

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

python/ql/test/library-tests/frameworks/data/test.expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ isSink
3030
| test.py:33:22:33:24 | ControlFlowNode for one | test-source |
3131
| test.py:33:27:33:29 | ControlFlowNode for two | test-source |
3232
| test.py:33:32:33:36 | ControlFlowNode for three | test-source |
33-
| test.py:57:7:57:12 | ControlFlowNode for ArgPos | test-source |
33+
| test.py:57:27:57:33 | ControlFlowNode for arg_pos | test-source |
3434
| test.py:66:17:66:20 | ControlFlowNode for arg1 | test-source |
3535
| test.py:66:23:66:26 | ControlFlowNode for arg2 | test-source |
3636
| test.py:66:34:66:43 | ControlFlowNode for namedThing | test-source |

python/ql/test/library-tests/frameworks/data/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class Sub2Class (CommonTokens.Class):
5454

5555
from testlib import ArgPos
5656

57-
val = ArgPos.selfThing(arg, named=2)
57+
arg_pos = ArgPos(); val = arg_pos.self_thing(arg, named=2);
5858

5959
class SubClass (ArgPos.MyClass):
6060
def foo(self, arg, named=2, otherName=3):
@@ -95,4 +95,4 @@ def secondAndAfter(self, arg1, arg2, arg3, arg4, arg5):
9595
baz1(baz1) # no match, and that's the point.
9696

9797
from foo2.bar import baz2
98-
baz2(baz2) # match
98+
baz2(baz2) # match

python/ql/test/library-tests/frameworks/data/test.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Sinks extends ModelInput::SinkModelCsv {
4444
"testlib;;Member[CallFilter].Member[arityOne].WithArity[1].Argument[any];test-source", //
4545
"testlib;;Member[CallFilter].Member[twoOrMore].WithArity[2..].Argument[0..];test-source", //
4646
// testing non-positional arguments
47-
"testlib;;Member[ArgPos].Member[selfThing].Argument[self];test-source", //
47+
"testlib;;Member[ArgPos].Instance.Member[self_thing].Argument[self];test-source", //
4848
// any argument
4949
"testlib;;Member[ArgPos].Member[anyParam].Argument[any];test-source", //
5050
"testlib;;Member[ArgPos].Member[anyNamed].Argument[any-named];test-source", //

0 commit comments

Comments
 (0)