Positive and negative fixtures prove a rule matches the right code and skips comments.
Fixtures & validation
Every new rule needs two small files: one that must match, one that must not.What you will do: drop fixtures under testdata/rules/<rule-id>/, then run make lint-rules.
Negative: the same text only in a comment, or a lookalike that is not the crypto API.
// crypto.createCipheriv is only mentioned in a comment.
Same idea for C: a real RSA_generate_key_ex(...) vs the name only in /* ... */.
Commands
make lint-rulesmake testmake check
Regenerate goldens only on purpose:
make golden
Review that diff. Do not accept it blindly.
make lint-rules currently requires fixtures for the flagship Go RSA rule. Still add positive and negative fixtures for every rule you ship. That is what keeps false positives out of other people’s CI.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"cryptarium","description":"Cryptographic discovery and CBOM generation for the post-quantum transition.","colors":{"primary":"#005DFC","light":"#3D7FFF","dark":"#031F45"},"logo":{"light":"https://mintcdn.com/cryptarium/ANhfuJiFU1kktFhD/logo/light.svg?fit=max\u0026auto=format\u0026n=ANhfuJiFU1kktFhD\u0026q=85\u0026s=90d92d484d4dbd8b40061a970426eba7","dark":"https://mintcdn.com/cryptarium/ANhfuJiFU1kktFhD/logo/dark.svg?fit=max\u0026auto=format\u0026n=ANhfuJiFU1kktFhD\u0026q=85\u0026s=ce057eb75fb4cc8348a55769075377e5","href":"/"},"favicon":"https://mintcdn.com/cryptarium/ANhfuJiFU1kktFhD/favicon.svg?fit=max\u0026auto=format\u0026n=ANhfuJiFU1kktFhD\u0026q=85\u0026s=f3be2e8aa877bf1fec064d45cc73f4be","appearance":{"default":"system"},"navbar":{"links":[{"href":"https://github.com/sgoveia/cryptarium","label":"GitHub"}],"primary":{"type":"button","label":"Install","href":"/install"}},"footer":{"socials":{"github":"https://github.com/sgoveia/cryptarium"}},"fonts":{"family":"Inter"},"styling":{"codeblocks":{"theme":"night-owl"},"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"cryptarium","hasAudioNarration":false,"actualSubdomain":"cryptarium","customDomains":["docs.cryptarium.dev"],"gitSource":{"type":"github","owner":"sgoveia","repo":"cryptarium","deployBranch":"main","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"},"NARRATION":{"status":"DISABLED"}},"buildId":"6acd8364bafd9391e75646b9","clientVersion":"0.0.4143","searchFilterCounts":[{"language":"default","tag":"Docs","count":22},{"language":"default","tag":"Concepts","count":6},{"language":"default","tag":"Guides","count":5},{"language":"default","tag":"Outputs","count":5},{"language":"default","tag":"Output formats","count":5},{"language":"default","tag":"CLI","count":4},{"language":"default","tag":"CLI reference","count":4},{"language":"default","tag":"Detectors \u0026 rules","count":4},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"Reference","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"detectors/fixtures","slug":"/detectors/fixtures","pageMetadata":{"title":"Fixtures \u0026 validation","description":"Positive and negative fixtures prove a rule matches the right code and skips comments.","href":"/detectors/fixtures"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Positive and negative fixtures prove a rule matches the right code and skips comments.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`1`,id:`fixtures-\u0026-validation`,children:`Fixtures \u0026 validation`}),`\n`,_jsxs(_components.p,{children:[`Every new rule needs two small files: one that `,_jsx(_components.strong,{children:`must`}),` match, one that `,_jsx(_components.strong,{children:`must not`}),`.`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`What you will do:`}),` drop fixtures under `,_jsx(_components.code,{children:`testdata/rules/\u003crule-id>/`}),`, then run `,_jsx(_components.code,{children:`make lint-rules`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`layout`,children:`Layout`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`text`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`3`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`testdata/rules/\u003crule-id>/positive.\u003cext>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`testdata/rules/\u003crule-id>/negative.\u003cext>`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsxs(_components.p,{children:[`Use the full rule `,_jsx(_components.code,{children:`id`}),` as the folder name (example: `,_jsx(_components.code,{children:`js.crypto.createcipheriv.aes`}),`).`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Language`}),_jsx(_components.th,{children:`Extension`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`JavaScript`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`.js`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`TypeScript`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`.ts`}),` (still tests the javascript pack)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`C`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`.c`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Go`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`.go`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Python`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`.py`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Java`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`.java`})})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`what-good-fixtures-look-like`,children:`What good fixtures look like`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Positive:`}),` one real call site, nothing else.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:`const`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` crypto`}),_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-dark\":`#C792EA`},children:` =`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:` require`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`(`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`crypto`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#7FDBCA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#7FDBCA`,\"--shiki-dark-font-style\":`italic`},children:`crypto`}),_jsx(_components.span,{style:{color:`#C792EA`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#C792EA`,\"--shiki-dark-font-style\":`italic`},children:`.`}),_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`createCipheriv`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`(`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:`aes-256-gcm`}),_jsx(_components.span,{style:{color:`#D9F5DD`,\"--shiki-dark\":`#D9F5DD`},children:`\"`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`, `}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:`key`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`, `}),_jsx(_components.span,{style:{color:`#D7DBE0`,\"--shiki-dark\":`#D7DBE0`},children:`iv`}),_jsx(_components.span,{style:{color:`#D6DEEB`,\"--shiki-dark\":`#D6DEEB`},children:`);`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Negative:`}),` the same text only in a comment, or a lookalike that is not the crypto API.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`1`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#637777`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#637777`,\"--shiki-dark-font-style\":`italic`},children:`// crypto.createCipheriv is only mentioned in a comment.`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Same idea for C: a real `,_jsx(_components.code,{children:`RSA_generate_key_ex(...)`}),` vs the name only in `,_jsx(_components.code,{children:`/* ... */`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`commands`,children:`Commands`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`make`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:` lint-rules`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`make`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:` test`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`make`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:` check`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Regenerate goldens only on purpose:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes night-owl night-owl`,style:{backgroundColor:`#011627`,\"--shiki-dark-bg\":`#011627`,color:`#d6deeb`,\"--shiki-dark\":`#d6deeb`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#82AAFF`,\"--shiki-light-font-style\":`italic`,\"--shiki-dark\":`#82AAFF`,\"--shiki-dark-font-style\":`italic`},children:`make`}),_jsx(_components.span,{style:{color:`#ECC48D`,\"--shiki-dark\":`#ECC48D`},children:` golden`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Review that diff. Do not accept it blindly.`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`make lint-rules`}),` currently requires fixtures for the flagship Go RSA rule. Still add positive and negative fixtures for every rule you ship. That is what keeps false positives out of other people’s CI.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/detectors/adding-a-rule`,children:`Adding a rule`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/detectors/rule-packs`,children:`Rule packs`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/concepts/determinism`,children:`Determinism`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":{"theme":"night-owl"},"config":{},"pageMetadata":{"title":"Fixtures \u0026 validation","description":"Positive and negative fixtures prove a rule matches the right code and skips comments.","href":"/detectors/fixtures"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Fixtures \u0026 validation","slug":"fixtures-\u0026-validation","depth":1,"children":[]},{"title":"Layout","slug":"layout","depth":2,"children":[]},{"title":"What good fixtures look like","slug":"what-good-fixtures-look-like","depth":2,"children":[]},{"title":"Commands","slug":"commands","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"cryptarium","siteName":"cryptarium","title":"Fixtures \u0026 validation - cryptarium","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-18T22:25:06.368Z","originalFileLocation":"detectors/fixtures.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Positive and negative fixtures prove a rule matches the right code and skips comments.\">\u003cmeta data-mint-head name=\"application-name\" content=\"cryptarium\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Fixtures \u0026amp; validation - cryptarium\">\u003cmeta data-mint-head property=\"og:description\" content=\"Positive and negative fixtures prove a rule matches the right code and skips comments.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"cryptarium\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.cryptarium.dev/detectors/fixtures\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://cryptarium.mintlify.site/_mintlify/api/og/v2?division=Detectors+%26+rules\u0026amp;title=Fixtures+%26+validation\u0026amp;description=Positive+and+negative+fixtures+prove+a+rule+matches+the+right+code+and+skips+comments.\u0026amp;theme=6d79725afb102272d041497a\u0026amp;signature=d257054df8a40fc1f9cb707b218db728ca16e72460100d9e93dbf0af156fe5d7\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Fixtures \u0026amp; validation - cryptarium\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Positive and negative fixtures prove a rule matches the right code and skips comments.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://cryptarium.mintlify.site/_mintlify/api/og/v2?division=Detectors+%26+rules\u0026amp;title=Fixtures+%26+validation\u0026amp;description=Positive+and+negative+fixtures+prove+a+rule+matches+the+right+code+and+skips+comments.\u0026amp;theme=6d79725afb102272d041497a\u0026amp;signature=d257054df8a40fc1f9cb707b218db728ca16e72460100d9e93dbf0af156fe5d7\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/cryptarium/wjtTa-geIIaHQggS/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"cryptarium\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#005DFC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.cryptarium.dev/detectors/fixtures\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/detectors/fixtures.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.cryptarium.dev/#organization\",\"name\":\"cryptarium\",\"url\":\"https://docs.cryptarium.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/cryptarium/ANhfuJiFU1kktFhD/logo/light.svg?fit=max\u0026auto=format\u0026n=ANhfuJiFU1kktFhD\u0026q=85\u0026s=90d92d484d4dbd8b40061a970426eba7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.cryptarium.dev#website\",\"name\":\"cryptarium\",\"url\":\"https://docs.cryptarium.dev\",\"publisher\":{\"@id\":\"https://docs.cryptarium.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.cryptarium.dev/detectors/fixtures#webpage\",\"url\":\"https://docs.cryptarium.dev/detectors/fixtures\",\"name\":\"Fixtures \u0026 validation\",\"description\":\"Positive and negative fixtures prove a rule matches the right code and skips comments.\",\"dateModified\":\"2026-09-18T22:25:06.368Z\",\"isPartOf\":{\"@id\":\"https://docs.cryptarium.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.cryptarium.dev/detectors/fixtures#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.cryptarium.dev/detectors/fixtures#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Detectors \u0026 rules\",\"item\":\"https://docs.cryptarium.dev/detectors/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fixtures \u0026 validation\",\"item\":\"https://docs.cryptarium.dev/detectors/fixtures\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.cryptarium.dev/detectors/fixtures#article\",\"headline\":\"Fixtures \u0026 validation\",\"name\":\"Fixtures \u0026 validation\",\"description\":\"Positive and negative fixtures prove a rule matches the right code and skips comments.\",\"url\":\"https://docs.cryptarium.dev/detectors/fixtures\",\"mainEntityOfPage\":{\"@id\":\"https://docs.cryptarium.dev/detectors/fixtures#webpage\"},\"dateModified\":\"2026-09-18T22:25:06.368Z\",\"publisher\":{\"@id\":\"https://docs.cryptarium.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.cryptarium.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"cryptarium\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"cryptarium\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/detectors/fixtures.md","siteName":"cryptarium","nav":{"global":null,"anchors":[{"anchor":"Docs","icon":"book-open","groups":[{"group":"Get started","pages":[{"title":"cryptarium","href":""},{"title":"Quickstart","href":"/quickstart"},{"title":"Install","href":"/install"},{"title":"What Cryptarium is not","href":"/what-it-is-not"}]},{"group":"Concepts","pages":[{"title":"Four evidence sources","href":"/concepts/evidence-sources"},{"title":"Correlation","href":"/concepts/correlation"},{"title":"Quantum classification","href":"/concepts/classification"},{"title":"Confidence \u0026 unknown","href":"/concepts/confidence"},{"title":"Determinism","href":"/concepts/determinism"},{"title":"Risk scoring","href":"/concepts/scoring"}]},{"group":"Detectors \u0026 rules","pages":[{"title":"Detectors overview","href":"/detectors/overview"},{"title":"Rule packs","href":"/detectors/rule-packs"},{"title":"Adding a rule","description":"Add C or JavaScript coverage in YAML: copy a rule, add fixtures, run lint.","href":"/detectors/adding-a-rule"},{"title":"Fixtures \u0026 validation","href":"/detectors/fixtures"}]},{"group":"Guides","pages":[{"title":"First scan in 5 minutes","description":"Copy-paste path from install to a Markdown migration report.","href":"/guides/first-scan"},{"title":"CI/CD \u0026 workflow integration","sidebarTitle":"CI/CD \u0026 workflows","icon":"diagram-project","href":"/guides/ci-cd"},{"title":"CI with --fail-on","href":"/guides/ci-fail-on"},{"title":"Uploading SARIF","href":"/guides/sarif-upload"},{"title":"Reading the migration report","href":"/guides/migration-report"}]},{"group":"Reference","pages":[{"title":"Canonical primitives","href":"/reference/primitives"},{"title":"Limitations \u0026 roadmap","href":"/reference/limitations"},{"title":"Changelog","href":"/reference/changelog"}]}]},{"anchor":"CLI","icon":"terminal","pages":[{"title":"CLI","href":"/cli/overview"}]},{"anchor":"Outputs","icon":"file-code","pages":[{"title":"Outputs","href":"/outputs/overview"}]},{"anchor":"GitHub","icon":"github","href":"https://github.com/sgoveia/cryptarium"}]},"basePath":"","title":"Fixtures \u0026 validation - cryptarium","buildId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","deploymentId":"dpl_Fyv1NbzwP68g2bEH2Roy98uY1zmE","dynamics":[],"chunks":[]}