Skip to content

Commit 890a67d

Browse files
committed
Introduce modules to merge 3, 4, and 5 inline expectation tests
1 parent 54db4cc commit 890a67d

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

shared/util/codeql/util/test/InlineExpectationsTest.qll

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,63 @@ module Make<InlineExpectationsTestSig Impl> {
396396
}
397397
}
398398

399+
/**
400+
* A module that merges three test signatures.
401+
*/
402+
module MergeTests3<TestSig TestImpl1, TestSig TestImpl2, TestSig TestImpl3> implements TestSig {
403+
private module M = MergeTests<MergeTests<TestImpl1, TestImpl2>, TestImpl3>;
404+
405+
string getARelevantTag() { result = M::getARelevantTag() }
406+
407+
predicate hasActualResult(Impl::Location location, string element, string tag, string value) {
408+
M::hasActualResult(location, element, tag, value)
409+
}
410+
411+
predicate hasOptionalResult(Impl::Location location, string element, string tag, string value) {
412+
M::hasOptionalResult(location, element, tag, value)
413+
}
414+
}
415+
416+
/**
417+
* A module that merges four test signatures.
418+
*/
419+
module MergeTests4<TestSig TestImpl1, TestSig TestImpl2, TestSig TestImpl3, TestSig TestImpl4>
420+
implements TestSig
421+
{
422+
private module M = MergeTests<MergeTests3<TestImpl1, TestImpl2, TestImpl3>, TestImpl4>;
423+
424+
string getARelevantTag() { result = M::getARelevantTag() }
425+
426+
predicate hasActualResult(Impl::Location location, string element, string tag, string value) {
427+
M::hasActualResult(location, element, tag, value)
428+
}
429+
430+
predicate hasOptionalResult(Impl::Location location, string element, string tag, string value) {
431+
M::hasOptionalResult(location, element, tag, value)
432+
}
433+
}
434+
435+
/**
436+
* A module that merges five test signatures.
437+
*/
438+
module MergeTests5<
439+
TestSig TestImpl1, TestSig TestImpl2, TestSig TestImpl3, TestSig TestImpl4, TestSig TestImpl5>
440+
implements TestSig
441+
{
442+
private module M =
443+
MergeTests<MergeTests4<TestImpl1, TestImpl2, TestImpl3, TestImpl4>, TestImpl5>;
444+
445+
string getARelevantTag() { result = M::getARelevantTag() }
446+
447+
predicate hasActualResult(Impl::Location location, string element, string tag, string value) {
448+
M::hasActualResult(location, element, tag, value)
449+
}
450+
451+
predicate hasOptionalResult(Impl::Location location, string element, string tag, string value) {
452+
M::hasOptionalResult(location, element, tag, value)
453+
}
454+
}
455+
399456
private module LegacyImpl implements TestSig {
400457
string getARelevantTag() { result = any(InlineExpectationsTest t).getARelevantTag() }
401458

0 commit comments

Comments
 (0)