mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
JS: Add utility for comparing results in tests
This commit is contained in:
17
javascript/ql/test/testUtilities/LegacyDataFlowDiff.qll
Normal file
17
javascript/ql/test/testUtilities/LegacyDataFlowDiff.qll
Normal file
@@ -0,0 +1,17 @@
|
||||
private import javascript
|
||||
|
||||
private signature class LegacyConfigSig extends DataFlow::Configuration;
|
||||
|
||||
module DataFlowDiff<DataFlow::GlobalFlowSig NewFlow, LegacyConfigSig LegacyConfig> {
|
||||
query predicate legacyDataFlowDifference(
|
||||
DataFlow::Node source, DataFlow::Node sink, string message
|
||||
) {
|
||||
NewFlow::flow(source, sink) and
|
||||
not any(LegacyConfig cfg).hasFlow(source, sink) and
|
||||
message = "only flow with NEW data flow library"
|
||||
or
|
||||
not NewFlow::flow(source, sink) and
|
||||
any(LegacyConfig cfg).hasFlow(source, sink) and
|
||||
message = "only flow with OLD data flow library"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user