add test for awaited

This commit is contained in:
Erik Krogh Kristensen
2022-04-27 11:01:10 +02:00
parent 48408ca45d
commit 682cab3737
3 changed files with 13 additions and 3 deletions

View File

@@ -38,6 +38,7 @@ isSource
| test.py:24:38:24:42 | ControlFlowNode for three | test-source |
| test.py:24:45:24:48 | ControlFlowNode for four | test-source |
| test.py:25:34:25:39 | ControlFlowNode for second | test-source |
| test.py:39:11:39:20 | ControlFlowNode for Await | test-source |
syntaxErrors
| Member[foo |
| Member[foo] .Member[bar] |

View File

@@ -30,4 +30,10 @@ 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
CallFilter.twoOrMore(one, two, three) # Match
from testlib import CommonTokens
async def async_func():
prom = CommonTokens.makePromise(1);
val = await prom

View File

@@ -53,12 +53,13 @@ class Sinks extends ModelInput::SinkModelCsv {
}
}
// TODO: Named parameters?
// TODO: Commonly used tokens
// TODO: Uniform tokens for fields
// TODO: Non-positional arguments
// TODO: Non-positional arguments (including Named parameters)
// TODO: Any argument
// TODO: Test taint steps.
// TODO: Should `instance()` be shorthand for `subClass*().getReturn()`?
// TODO: // There are no API-graph edges for: ArrayElement, Element, MapKey, MapValue (remove from valid tokens list)
class Sources extends ModelInput::SourceModelCsv {
// package;type;path;kind
override predicate row(string row) {
@@ -70,6 +71,8 @@ class Sources extends ModelInput::SourceModelCsv {
"testlib;;Member[Callbacks].Member[first].Argument[0].Parameter[0];test-source", //
"testlib;;Member[Callbacks].Member[param1to3].Argument[0].Parameter[1..3];test-source", //
"testlib;;Member[Callbacks].Member[nonFirst].Argument[0].Parameter[1..];test-source", //
// Common tokens.
"testlib;;Member[CommonTokens].Member[makePromise].ReturnValue.Awaited;test-source", //
]
}
}