mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
add tests for argument syntax
This commit is contained in:
@@ -11,6 +11,12 @@ isSink
|
||||
| test.py:10:8:10:22 | ControlFlowNode for Attribute() | test-sink |
|
||||
| test.py:11:8:11:30 | ControlFlowNode for Attribute() | test-sink |
|
||||
| test.py:12:8:12:34 | ControlFlowNode for Attribute() | test-sink |
|
||||
| test.py:16:11:16:13 | ControlFlowNode for one | test-source |
|
||||
| test.py:17:19:17:21 | ControlFlowNode for two | test-source |
|
||||
| test.py:17:24:17:28 | ControlFlowNode for three | test-source |
|
||||
| test.py:17:31:17:34 | ControlFlowNode for four | test-source |
|
||||
| test.py:18:37:18:40 | ControlFlowNode for five | test-source |
|
||||
| test.py:19:21:19:26 | ControlFlowNode for second | test-source |
|
||||
isSource
|
||||
| test.py:3:5:3:15 | ControlFlowNode for getSource() | test-source |
|
||||
| test.py:9:8:9:14 | ControlFlowNode for alias() | test-source |
|
||||
|
||||
@@ -9,4 +9,11 @@ mySink(sinkName=x) # NOT OK
|
||||
mySink(alias()) # NOT OK
|
||||
mySink(alias().chain()) # NOT OK
|
||||
mySink(alias().chain().chain()) # NOT OK
|
||||
mySink(alias().chain().safeThing()) # OK
|
||||
mySink(alias().chain().safeThing()) # OK
|
||||
|
||||
from testlib import Args
|
||||
|
||||
Args.arg0(one, two, three, four, five)
|
||||
Args.arg1to3(one, two, three, four, five)
|
||||
Args.lastarg(one, two, three, four, five)
|
||||
Args.nonFist(first, second)
|
||||
@@ -38,7 +38,15 @@ class Types extends ModelInput::TypeModelCsv {
|
||||
class Sinks extends ModelInput::SinkModelCsv {
|
||||
override predicate row(string row) {
|
||||
// package;type;path;kind
|
||||
row = ["testlib;;Member[mySink].Argument[0,sinkName:];test-sink"]
|
||||
row =
|
||||
[
|
||||
"testlib;;Member[mySink].Argument[0,sinkName:];test-sink",
|
||||
// testing argument syntax
|
||||
"testlib;;Member[Args].Member[arg0].Argument[0];test-source", //
|
||||
"testlib;;Member[Args].Member[arg1to3].Argument[1..3];test-source", //
|
||||
"testlib;;Member[Args].Member[lastarg].Argument[N-1];test-source", //
|
||||
"testlib;;Member[Args].Member[nonFist].Argument[1..];test-source", //
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +60,7 @@ class Sources extends ModelInput::SourceModelCsv {
|
||||
row =
|
||||
[
|
||||
"testlib;;Member[getSource].ReturnValue;test-source", //
|
||||
"testlib;Alias;;test-source"
|
||||
"testlib;Alias;;test-source",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user