testConflictEditSaysWhatEachSideChanged

tcmts.cli.test.e2e.merge.testConflictEditSaysWhatEachSideChanged · #centsocm · term

tcm edit of a conflict says what each side changed from the base (lines added and taken out, and where they are in the file), and how many stretches both changed.

import { withConflicts } from "#codebase/tcmts/cli/test/e2e/merge";
import assert from "node:assert/strict";

export const testConflictEditSaysWhatEachSideChanged = () => {
  const { tcm } = withConflicts("merge summary");
  const out = tcm("edit", "lib.k");
  assert.match(out, /lib\.k: ours \(s\) and theirs \(main\), merged from the base/);
  assert.match(out, /ours: \+1 −1 lines, at lines 3–9\n/);
  assert.match(out, /theirs: \+2 −2 lines, at lines 3–9, 11\n/);
  assert.match(out, /both: 1 stretch changed differently, marked at lines 3–9\n/);
}

uses