diff --git a/tests/test_issue21_loop_b.py b/tests/test_issue21_loop_b.py index f7742f2..9918e01 100644 --- a/tests/test_issue21_loop_b.py +++ b/tests/test_issue21_loop_b.py @@ -332,12 +332,14 @@ def test_l13_snapshot_diff_is_commit_to_commit(wt_repo, monkeypatch, tmp_path): # the two-argument form is unchanged: same output as the script before this change old = subprocess.run(["git", "-C", str(SKILLS.parent.parent), "show", "25f4be3:.agents/skills/multi-agent-mux-loop/scripts/diff_collect.sh"], capture_output=True, text=True) - old_sh = tmp_path / "diff_collect_old.sh" - old_sh.write_text(old.stdout) new2 = _diff_collect(wt, base) - old2 = subprocess.run(["bash", "-c", f"source '{old_sh}' && mam_collect_changes_diff '{wt}' '{base}'"], - capture_output=True, text=True) - assert (new2.returncode, new2.stdout) == (old2.returncode, old2.stdout) + assert new2.returncode == 0 and "+modified" in new2.stdout and "+untracked" in new2.stdout + if old.returncode == 0 and old.stdout: # needs git history (absent in a `git archive` export) + old_sh = tmp_path / "diff_collect_old.sh" + old_sh.write_text(old.stdout) + old2 = subprocess.run(["bash", "-c", f"source '{old_sh}' && mam_collect_changes_diff '{wt}' '{base}'"], + capture_output=True, text=True) + assert (new2.returncode, new2.stdout) == (old2.returncode, old2.stdout) def test_l13b_prompt_diff_comes_from_the_snapshot(wt_repo, monkeypatch, tmp_path):