add tests for callsite filters

This commit is contained in:
Erik Krogh Kristensen
2022-04-27 09:41:13 +02:00
parent 20992af037
commit 8d60336396
3 changed files with 18 additions and 1 deletions

View File

@@ -17,6 +17,12 @@ isSink
| 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 |
| test.py:30:21:30:23 | ControlFlowNode for one | test-source |
| test.py:32:22:32:24 | ControlFlowNode for one | test-source |
| test.py:32:27:32:29 | ControlFlowNode for two | test-source |
| test.py:33:22:33:24 | ControlFlowNode for one | test-source |
| test.py:33:27:33:29 | ControlFlowNode for two | test-source |
| test.py:33:32:33:36 | ControlFlowNode for three | 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 |

View File

@@ -22,4 +22,12 @@ from testlib import Callbacks
Callbacks.first(lambda one, two, three, four, five: 0)
Callbacks.param1to3(lambda one, two, three, four, five: 0)
Callbacks.nonFirst(lambda first, second: 0)
Callbacks.nonFirst(lambda first, second: 0)
from testlib import CallFilter
CallFilter.arityOne(one, two) # NO match
CallFilter.arityOne(one) # Match
CallFilter.twoOrMore(one) # NO match
CallFilter.twoOrMore(one, two) # Match
CallFilter.twoOrMore(one, two, three) # Match

View File

@@ -46,6 +46,9 @@ class Sinks extends ModelInput::SinkModelCsv {
"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", //
// callsite filter.
"testlib;;Member[CallFilter].Member[arityOne].WithArity[1].Argument[0..];test-source", //
"testlib;;Member[CallFilter].Member[twoOrMore].WithArity[2..].Argument[0..];test-source", //
]
}
}