Files
codeql/rust/ql/test/extractor-tests/generated/Module/Module.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

67 lines
2.6 KiB
Plaintext
Generated

// generated by codegen, do not edit
import codeql.rust.elements
import TestUtils
query predicate instances(
Module x, string hasExtendedCanonicalPath__label, string hasExtendedCanonicalPath,
string hasCrateOrigin__label, string hasCrateOrigin, string hasAttributeMacroExpansion__label,
string hasAttributeMacroExpansion, string getNumberOfAttrs__label, int getNumberOfAttrs,
string hasItemList__label, string hasItemList, string hasName__label, string hasName,
string hasVisibility__label, string hasVisibility
) {
toBeTested(x) and
not x.isUnknown() and
hasExtendedCanonicalPath__label = "hasExtendedCanonicalPath:" and
(
if x.hasExtendedCanonicalPath()
then hasExtendedCanonicalPath = "yes"
else hasExtendedCanonicalPath = "no"
) and
hasCrateOrigin__label = "hasCrateOrigin:" and
(if x.hasCrateOrigin() then hasCrateOrigin = "yes" else hasCrateOrigin = "no") and
hasAttributeMacroExpansion__label = "hasAttributeMacroExpansion:" and
(
if x.hasAttributeMacroExpansion()
then hasAttributeMacroExpansion = "yes"
else hasAttributeMacroExpansion = "no"
) and
getNumberOfAttrs__label = "getNumberOfAttrs:" and
getNumberOfAttrs = x.getNumberOfAttrs() and
hasItemList__label = "hasItemList:" and
(if x.hasItemList() then hasItemList = "yes" else hasItemList = "no") and
hasName__label = "hasName:" and
(if x.hasName() then hasName = "yes" else hasName = "no") and
hasVisibility__label = "hasVisibility:" and
if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no"
}
query predicate getExtendedCanonicalPath(Module x, string getExtendedCanonicalPath) {
toBeTested(x) and not x.isUnknown() and getExtendedCanonicalPath = x.getExtendedCanonicalPath()
}
query predicate getCrateOrigin(Module x, string getCrateOrigin) {
toBeTested(x) and not x.isUnknown() and getCrateOrigin = x.getCrateOrigin()
}
query predicate getAttributeMacroExpansion(Module x, MacroItems getAttributeMacroExpansion) {
toBeTested(x) and
not x.isUnknown() and
getAttributeMacroExpansion = x.getAttributeMacroExpansion()
}
query predicate getAttr(Module x, int index, Attr getAttr) {
toBeTested(x) and not x.isUnknown() and getAttr = x.getAttr(index)
}
query predicate getItemList(Module x, ItemList getItemList) {
toBeTested(x) and not x.isUnknown() and getItemList = x.getItemList()
}
query predicate getName(Module x, Name getName) {
toBeTested(x) and not x.isUnknown() and getName = x.getName()
}
query predicate getVisibility(Module x, Visibility getVisibility) {
toBeTested(x) and not x.isUnknown() and getVisibility = x.getVisibility()
}