Files
codeql/rust/ql/test/extractor-tests/generated/ConstParam/ConstParam.ql
Paolo Tranquilli 6bbf1e3bc1 Codegen: use one generated test file per directory
This collapses all generated test QL sources into a single one per
directory, using query predicates to run the different tests.

This should improve the time required to run generated tests.
2025-06-25 11:44:54 +02:00

39 lines
1.5 KiB
Plaintext
Generated

// generated by codegen, do not edit
import codeql.rust.elements
import TestUtils
query predicate instances(
ConstParam x, string getNumberOfAttrs__label, int getNumberOfAttrs, string hasDefaultVal__label,
string hasDefaultVal, string isConst__label, string isConst, string hasName__label,
string hasName, string hasTypeRepr__label, string hasTypeRepr
) {
toBeTested(x) and
not x.isUnknown() and
getNumberOfAttrs__label = "getNumberOfAttrs:" and
getNumberOfAttrs = x.getNumberOfAttrs() and
hasDefaultVal__label = "hasDefaultVal:" and
(if x.hasDefaultVal() then hasDefaultVal = "yes" else hasDefaultVal = "no") and
isConst__label = "isConst:" and
(if x.isConst() then isConst = "yes" else isConst = "no") and
hasName__label = "hasName:" and
(if x.hasName() then hasName = "yes" else hasName = "no") and
hasTypeRepr__label = "hasTypeRepr:" and
if x.hasTypeRepr() then hasTypeRepr = "yes" else hasTypeRepr = "no"
}
query predicate getAttr(ConstParam x, int index, Attr getAttr) {
toBeTested(x) and not x.isUnknown() and getAttr = x.getAttr(index)
}
query predicate getDefaultVal(ConstParam x, ConstArg getDefaultVal) {
toBeTested(x) and not x.isUnknown() and getDefaultVal = x.getDefaultVal()
}
query predicate getName(ConstParam x, Name getName) {
toBeTested(x) and not x.isUnknown() and getName = x.getName()
}
query predicate getTypeRepr(ConstParam x, TypeRepr getTypeRepr) {
toBeTested(x) and not x.isUnknown() and getTypeRepr = x.getTypeRepr()
}