testResolveBySide
tcm resolve --ours / --theirs keeps a side's definition by its side, as it is now: resolving one conflict
re-derives the other side's code that used the definition it drops, so a hash copied before would be stale.
import { tcmIn } from "#codebase/tcmts/cli/test/e2e/harness"; import { withConflicts } from "#codebase/tcmts/cli/test/e2e/merge"; import assert from "node:assert/strict"; export const testResolveBySide = () => { const { dir, tcm, sides } = withConflicts("merge resolve by side"); const before = sides("lib.m"); assert.match(tcmIn(dir, "resolve", "lib.k", "--ours", "--theirs").out, /--ours or --theirs/); tcm("resolve", "lib.k", "--ours"); const after = sides("lib.m"); assert.notEqual( after.theirs, before.theirs, "main's m used main's k: it's re-derived against s's", ); tcm("resolve", "lib.m", "--theirs"); assert.equal(tcm("run", "lib.user").trim(), String((10 + 2 + 3 + 3) * 10)); const todo = tcm("todo"); assert.match(todo, /nothing to do/); assert.doesNotMatch(todo, /unnamed version/); }