Skip to content

Commit 607204f

Browse files
test: recognize tilde-fenced code blocks in command-doc gate
Refs #1420 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
1 parent 4c3aa3c commit 607204f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎src/__tests__/command-doc-coverage.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function extractDocumentedCommandTokens(markdown: string): Map<string, number> {
4141
const lines = markdown.split('\n');
4242
for (let index = 0; index < lines.length; index++) {
4343
const line = lines[index] ?? '';
44-
if (/^\s*```/.test(line)) {
44+
if (/^\s*(?:```|~~~)/.test(line)) {
4545
insideFence = !insideFence;
4646
continue;
4747
}
@@ -183,6 +183,12 @@ describe('command reference doc coverage gate behavior', () => {
183183
assert.equal(tokens.get('boot'), 7);
184184
});
185185

186+
test('extraction also recognizes tilde-fenced code blocks', () => {
187+
const sample = ['~~~bash', 'agent-device snapshot -i', '~~~'].join('\n');
188+
const tokens = extractDocumentedCommandTokens(sample);
189+
assert.deepEqual([...tokens.keys()], ['snapshot']);
190+
});
191+
186192
test('adding a public command without touching commands.md fails, naming file and command', () => {
187193
const withNewCommand = [...publicCommands, 'brand-new-command'];
188194
const missing = findUndocumentedPublicCommands(

0 commit comments

Comments
 (0)