Merge pull request #4018 (rudycelekli) into batch

This commit is contained in:
r committed 2026-10-12 13:31:49 -04:00
commit e8c48e6402
2 files changed
+12

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
import { test } from 'vitest';
import assert from 'node:assert/strict';
import { OutputFormatter } from '../v3/@claude-flow/cli-core/src/output.ts';
test('one to three character columns never overflow their border', () => {
const f = new OutputFormatter({ color: false });
for (const width of [1, 2, 3, 4]) {
const lines = f.table({ columns: [{ key: 'value', header: 'Header', width }], data: [{ value: 'Longer content' }] }).split('\n');
for (const line of lines) assert.equal(line.length, lines[0].length);
assert.equal(lines[0].length, width + 4);
}
});
+1
View File
@@ -371,6 +371,7 @@ export class OutputFormatter {
private truncate(text: string, maxLength: number): string {
const stripped = this.stripAnsi(text);
if (stripped.length <= maxLength) return text;
if (maxLength <= 3) return '.'.repeat(Math.max(0, maxLength));
return stripped.slice(0, maxLength - 3) + '...';
}