From a59f71e85177a3318ea1a03e188ffd21a7b19b6f Mon Sep 17 00:00:00 2001 From: sean Date: Sun, 11 Oct 2026 22:58:21 +0100 Subject: [PATCH] test(box): the review test no longer fails when a commit's hash ends in 0 It made an "unseen" commit by replacing the last digit of the real one with 0, so one run in sixteen asked to update to the commit already checked out and was, rightly, not refused. Co-Authored-By: Claude Opus 5.5 --- internal/box/prreview_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/box/prreview_test.go b/internal/box/prreview_test.go index ae4c74dd..c34df8d3 100644 --- a/internal/box/prreview_test.go +++ b/internal/box/prreview_test.go @@ -232,8 +232,14 @@ func TestAReviewIsMadeAtTheConfirmedCommitAndNothingElse(t *testing.T) { if got := headOf(t, wt.Path); got != sha { t.Fatalf("the review moved by itself to %s", got) } - // Updating to a commit the reviewer was not shown is refused. - if _, err := f.b.UpdateReview(context.Background(), "app", ReviewUpdate{Location: "shop", Worktree: "review-42", SHA: sha[:39] + "0"}); codeOf(err) != "moved" { + // Updating to a commit the reviewer was not shown is refused. The unseen + // one differs in its last digit, whatever that digit is: one commit in + // sixteen already ends in 0. + unseen := sha[:39] + "0" + if unseen == sha { + unseen = sha[:39] + "1" + } + if _, err := f.b.UpdateReview(context.Background(), "app", ReviewUpdate{Location: "shop", Worktree: "review-42", SHA: unseen}); codeOf(err) != "moved" { t.Fatalf("update to an unseen commit: %v", err) } // With uncommitted changes it stays put.