JS: Add utility for comparing results in tests

This commit is contained in:
Asger F
2023-10-05 09:29:42 +02:00
parent 43be45207d
commit d35959a098

View 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"
}
}