@@ -1692,39 +1692,27 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
16921692 )
16931693 }
16941694
1695- signature module TestSourceSinkInputSig {
1696- /**
1697- * A class or source elements relevant for testing.
1698- */
1699- class RelevantSourceCallable instanceof SourceOrSinkElement {
1700- /** Gets the string representation of this callable used by `source/1`. */
1701- string getCallableCsv ( ) ;
1702- }
1703-
1704- /**
1705- * A class or sink elements relevant for testing.
1706- */
1707- class RelevantSinkCallable instanceof SourceOrSinkElement {
1708- /** Gets the string representation of this callable used by `source/1`. */
1709- string getCallableCsv ( ) ;
1710- }
1695+ /** A source or sink relevant for testing. */
1696+ signature class RelevantSourceOrSinkElementSig extends SourceOrSinkElement {
1697+ /** Gets the string representation of this callable used by `source/1` or `sink/1`. */
1698+ string getCallableCsv ( ) ;
17111699 }
17121700
17131701 /** Provides query predicates for outputting a set of relevant sources and sinks. */
1714- module TestSourceSinkOutput< TestSourceSinkInputSig TestSourceSinkInput > {
1715- private import TestSourceSinkInput
1716-
1702+ module TestSourceSinkOutput<
1703+ RelevantSourceOrSinkElementSig RelevantSource , RelevantSourceOrSinkElementSig RelevantSink >
1704+ {
17171705 /**
17181706 * Holds if there exists a relevant source callable with information roughly corresponding to `csv`.
17191707 * Used for testing.
17201708 * The syntax is: "namespace;type;overrides;name;signature;ext;outputspec;kind;provenance",
17211709 * ext is hardcoded to empty.
17221710 */
17231711 query predicate source ( string csv ) {
1724- exists ( RelevantSourceCallable c , string output , string kind , Provenance provenance |
1725- sourceElement ( c , output , kind , provenance ) and
1712+ exists ( RelevantSource s , string output , string kind , Provenance provenance |
1713+ sourceElement ( s , output , kind , provenance ) and
17261714 csv =
1727- c .getCallableCsv ( ) // Callable information
1715+ s .getCallableCsv ( ) // Callable information
17281716 + output + ";" // output
17291717 + kind + ";" // kind
17301718 + provenance // provenance
@@ -1738,10 +1726,10 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
17381726 * ext is hardcoded to empty.
17391727 */
17401728 query predicate sink ( string csv ) {
1741- exists ( RelevantSinkCallable c , string input , string kind , Provenance provenance |
1742- sinkElement ( c , input , kind , provenance ) and
1729+ exists ( RelevantSink s , string input , string kind , Provenance provenance |
1730+ sinkElement ( s , input , kind , provenance ) and
17431731 csv =
1744- c .getCallableCsv ( ) // Callable information
1732+ s .getCallableCsv ( ) // Callable information
17451733 + input + ";" // input
17461734 + kind + ";" // kind
17471735 + provenance // provenance
@@ -1751,35 +1739,18 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
17511739 }
17521740 }
17531741
1754- signature module TestSummaryInputSig {
1755- /**
1756- * A class of callables where the flow summary should be included
1757- * in the `summary/1` query predicate.
1758- */
1759- class RelevantSummarizedCallable instanceof SummarizedCallableImpl {
1760- /** Gets the string representation of this callable used by `summary/1`. */
1761- string getCallableCsv ( ) ;
1762- }
1742+ /** A summarized callable relevant for testing. */
1743+ signature class RelevantSummarizedCallableSig extends SummarizedCallableImpl {
1744+ /** Gets the string representation of this callable used by `summary/1`. */
1745+ string getCallableCsv ( ) ;
1746+
1747+ predicate relevantSummary (
1748+ SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
1749+ ) ;
17631750 }
17641751
17651752 /** Provides a query predicate for outputting a set of relevant flow summaries. */
1766- module TestSummaryOutput< TestSummaryInputSig TestInput> {
1767- private import TestInput
1768-
1769- final class RelevantSummarizedCallableFinal = TestInput:: RelevantSummarizedCallable ;
1770-
1771- class RelevantSummarizedCallable extends RelevantSummarizedCallableFinal instanceof SummarizedCallableImpl
1772- {
1773- /** Holds if flow is propagated between `input` and `output`. */
1774- predicate relevantSummary (
1775- SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
1776- ) {
1777- super .propagatesFlow ( input , output , preservesValue )
1778- }
1779-
1780- string toString ( ) { result = super .toString ( ) }
1781- }
1782-
1753+ module TestSummaryOutput< RelevantSummarizedCallableSig RelevantSummarizedCallable> {
17831754 /** Render the kind in the format used in flow summaries. */
17841755 private string renderKind ( boolean preservesValue ) {
17851756 preservesValue = true and result = "value"
@@ -1816,31 +1787,13 @@ module Make<DF::InputSig DataFlowLang, InputSig<DataFlowLang> Input> {
18161787 }
18171788 }
18181789
1819- signature module TestNeutralInputSig {
1820- /**
1821- * A class of callables where the neutral model should be included
1822- * in the `neutral/1` query predicate.
1823- */
1824- class RelevantNeutralCallable instanceof NeutralCallable {
1825- /** Gets the string representation of this callable used by `neutral/1`. */
1826- string getCallableCsv ( ) ;
1827- }
1790+ /** A summarized callable relevant for testing. */
1791+ signature class RelevantNeutralCallableSig extends NeutralCallable {
1792+ /** Gets the string representation of this callable used by `neutral/1`. */
1793+ string getCallableCsv ( ) ;
18281794 }
18291795
1830- module TestNeutralOutput< TestNeutralInputSig TestInput> {
1831- private import TestInput
1832-
1833- final class RelevantNeutralCallableFinal = TestInput:: RelevantNeutralCallable ;
1834-
1835- class RelevantNeutralCallable extends RelevantNeutralCallableFinal instanceof NeutralCallable {
1836- /**
1837- * Gets the kind of the neutral.
1838- */
1839- string getKind ( ) { result = super .getKind ( ) }
1840-
1841- string toString ( ) { result = super .toString ( ) }
1842- }
1843-
1796+ module TestNeutralOutput< RelevantNeutralCallableSig RelevantNeutralCallable> {
18441797 private string renderProvenance ( NeutralCallable c ) {
18451798 exists ( Provenance p | p .isManual ( ) and c .hasProvenance ( p ) and result = p .toString ( ) )
18461799 or
0 commit comments