Answer stability round 1: 0 🔴, 17 🟡 (0 misread); read line ends as before, drop a stale copy, say why a read failed, and test each failure the round named

This commit is contained in:
2026-11-14 00:25:16 +01:00
parent d15380249d
commit b2142ee620
14 changed files with 151 additions and 43 deletions
+21
View File
@@ -201,6 +201,27 @@ class ChunkItem(unittest.TestCase):
run("commit", "-q", "--allow-empty", "-m", "Side work")
self.assertEqual(release_standing.default_plan(repo, "main", "todo.md", changelog_of(repo)).cut.commits, 2, "the commits after Cut 0.0.1 on main")
def test_reads_the_changelog_and_its_cut_on_the_named_branch_whatever_is_checked_out(self):
repo = tempfile.mkdtemp()
self.addCleanup(subprocess.run, ["rm", "-rf", repo])
run = lambda *args: subprocess.run(["git", "-c", "user.name=t", "-c", "user.email=t@t", *args], capture_output=True, check=True, cwd=repo, env=isolated_env(), text=True)
changelog = pathlib.Path(repo, "CHANGELOG.md")
run("init", "-q", "-b", "main")
changelog.write_text("# Changelog\n\n## Unreleased\n")
run("add", ".")
run("commit", "-q", "-m", "Start")
run("checkout", "-q", "-b", "side")
changelog.write_text("# Changelog\n\n## 0.0.1 - 2026-10-02\n\n- Side.\n")
run("commit", "-q", "-am", "Cut 0.0.1 on the side")
run("checkout", "-q", "main")
changelog.write_text("# Changelog\n\n## 0.0.1 - 2026-10-03\n")
run("commit", "-q", "-am", "Cut 0.0.1")
run("commit", "-q", "--allow-empty", "-m", "Ship item 2")
run("checkout", "-q", "side")
changelog.write_text("# Changelog\n\nAn edit nobody committed.\n")
cut = release_standing.default_plan(repo, "main", "todo.md", changelog_of(repo)).cut
self.assertEqual((cut.changelog, cut.commits), ("# Changelog\n\n## 0.0.1 - 2026-10-03\n", 1), "main's changelog, and the commit after Cut 0.0.1 on main")
def test_takes_the_tag_over_a_dated_heading_and_counts_every_commit_without_either(self):
repo = tempfile.mkdtemp()
self.addCleanup(subprocess.run, ["rm", "-rf", repo])