From c66a842ce4679a3ffa5504dad39b1402bea75e9f Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 14 Sep 2026 23:07:57 +0200 Subject: plan 10 re-check: cut run column, damaged undo run, emptied directory cleanup, text turning binary, explain flags, interrupt docs --- cmd/krino/history_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'cmd/krino/history_test.go') diff --git a/cmd/krino/history_test.go b/cmd/krino/history_test.go index 7c0f810..9c409bc 100644 --- a/cmd/krino/history_test.go +++ b/cmd/krino/history_test.go @@ -142,11 +142,14 @@ func TestFinalizeUndoPlanMarksUnapprovedAsDeclined(t *testing.T) { {File: "a"}, // index 0: approved {File: "b"}, // index 1: not approved -> declined {File: "c", Refused: "gone"}, // index 2: refused, never declined - }} + }, Cleanup: []engine.UndoFile{{File: "d"}}} out, _ := finalizeUndoPlan(up, map[int]bool{0: true}, 'c') if len(out.Files) != 3 { t.Fatalf("files = %+v, want all three carried through", out.Files) } + if len(out.Cleanup) != 1 || out.Cleanup[0].File != "d" { + t.Errorf("Cleanup = %+v, want the plan's directory cleanup carried over", out.Cleanup) + } if out.Files[0].Declined || out.Files[0].Refused != "" { t.Errorf("approved file changed: %+v", out.Files[0]) } @@ -542,6 +545,10 @@ func TestIgnoredGlobalFlagsAreRefused(t *testing.T) { {"-v", "log"}, {"--json", "undo", "-n"}, {"-v", "undo", "-n"}, + {"-y", "explain", dl}, + {"-n", "explain", dl}, + {"--json", "explain", dl}, + {"-v", "explain", dl}, } { if code, _, errOut := runCLI(t, args...); code != 2 || !strings.Contains(errOut, "does not take") { t.Errorf("krino %q: exit %d, stderr %q; want 2, refused", args, code, errOut) -- cgit v1.3