@@ -84,6 +84,44 @@ private import internal.FlowSummaryImpl::Private
8484private import internal.FlowSummaryImpl:: Private:: External
8585private import codeql.mad.ModelValidation as SharedModelVal
8686
87+ /**
88+ * Holds if the given extension tuple `madId` should pretty-print as `model`.
89+ *
90+ * This predicate should only be used in tests.
91+ */
92+ predicate interpretModelForTest ( QlBuiltins:: ExtensionId madId , string model ) {
93+ exists (
94+ string package , string type , boolean subtypes , string name , string signature , string ext ,
95+ string output , string kind , string provenance
96+ |
97+ sourceModel ( package , type , subtypes , name , signature , ext , output , kind , provenance , madId ) and
98+ model =
99+ "Source: " + package + "; " + type + "; " + subtypes + "; " + name + "; " + signature + "; " +
100+ ext + "; " + output + "; " + kind + "; " + provenance
101+ )
102+ or
103+ exists (
104+ string package , string type , boolean subtypes , string name , string signature , string ext ,
105+ string input , string kind , string provenance
106+ |
107+ sinkModel ( package , type , subtypes , name , signature , ext , input , kind , provenance , madId ) and
108+ model =
109+ "Sink: " + package + "; " + type + "; " + subtypes + "; " + name + "; " + signature + "; " +
110+ ext + "; " + input + "; " + kind + "; " + provenance
111+ )
112+ or
113+ exists (
114+ string package , string type , boolean subtypes , string name , string signature , string ext ,
115+ string input , string output , string kind , string provenance
116+ |
117+ summaryModel ( package , type , subtypes , name , signature , ext , input , output , kind , provenance ,
118+ madId ) and
119+ model =
120+ "Summary: " + package + "; " + type + "; " + subtypes + "; " + name + "; " + signature + "; " +
121+ ext + "; " + input + "; " + output + "; " + kind + "; " + provenance
122+ )
123+ }
124+
87125private predicate relevantPackage ( string package ) {
88126 sourceModel ( package , _, _, _, _, _, _, _, _, _) or
89127 sinkModel ( package , _, _, _, _, _, _, _, _, _) or
0 commit comments