Skip to content

Commit 668b02a

Browse files
committed
Improve test coverage - add alignment verification for docblock generator
1 parent c5b42ab commit 668b02a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/test/suite/docblockGenerator.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ suite('Docblock Generator Test Suite', () => {
8787
const paramLines = lines.filter((line) => line.includes('@param'));
8888
assert.strictEqual(paramLines.length, 2);
8989

90-
// Check that padding is applied (types and names should be padded)
91-
assert.ok(paramLines[0].includes('string'));
92-
assert.ok(paramLines[1].includes('int'));
90+
// Verify padding: variable names should start at the same column
91+
const index1 = paramLines[0].indexOf('$a');
92+
const index2 = paramLines[1].indexOf('$longer_name');
93+
assert.strictEqual(index1, index2, 'Variable names should be aligned at same column');
94+
95+
// The first line should have padding after 'string' to align with 'int'
96+
assert.ok(paramLines[0].match(/@param\s+string\s+\$a/), 'Should have padding between type and variable');
9397
});
9498

9599
test('Should handle params without types', () => {

0 commit comments

Comments
 (0)