import { describe, it, expect } from 'vitest';
import { summarizeNumstat } from '../gitTools.js';

describe('git_diff_summarize helpers', () => {
  it('parses numstat lines including binary files', () => {
    const files = summarizeNumstat(
      ['10\t2\tsrc/a.ts', '3\t0\tREADME.md', '-\t-\tlogo.png', ''].join('\n'),
    );
    expect(files).toHaveLength(3);
    expect(files[0]).toEqual({ path: 'src/a.ts', insertions: 10, deletions: 2, binary: false });
    expect(files[2]).toMatchObject({ path: 'logo.png', insertions: 0, deletions: 0, binary: true });
  });
});
