aboutsummaryrefslogtreecommitdiff
path: root/internal/plan/enum_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 21:43:23 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 21:43:23 +0200
commitc497d173b24b1b8247fac9e996e5c0fe690c1769 (patch)
tree2318ff1cf393e3a6c2a7d54c89e205ac6a9a5c73 /internal/plan/enum_test.go
parent360591d6e18d8676a2f86185ed42f46852387f85 (diff)
downloadkrino-c497d173b24b1b8247fac9e996e5c0fe690c1769.tar.gz
krino-c497d173b24b1b8247fac9e996e5c0fe690c1769.zip
plan 9: undo review matches review, --min-age validated, future mtimes, rule names, conflict enum, dependency gate, absolute tool paths
Diffstat (limited to 'internal/plan/enum_test.go')
-rw-r--r--internal/plan/enum_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/plan/enum_test.go b/internal/plan/enum_test.go
index 6458f5f..5e4f645 100644
--- a/internal/plan/enum_test.go
+++ b/internal/plan/enum_test.go
@@ -45,3 +45,30 @@ func TestEveryKindIsNamed(t *testing.T) {
}()
}
}
+
+// TestEveryConflictPolicyIsPlanned: every config.Conflict value is resolved
+// by its own branch; an unknown value panics instead of quietly planning as
+// suffix (review cli F13). Conflict is an iota block from 0.
+func TestEveryConflictPolicyIsPlanned(t *testing.T) {
+ policies, err := enumtest.Names("../config/settings.go", "Conflict")
+ if err != nil {
+ t.Fatal(err)
+ }
+ d := fakeDisk{exists: map[string]bool{"/r/b.pdf": true}}
+ for i, name := range policies {
+ func() {
+ defer func() {
+ if r := recover(); r != nil {
+ t.Errorf("config.%s is not planned: %v", name, r)
+ }
+ }()
+ resolveConflict(Move, config.Conflict(i), "/r/a.pdf", "/r/b.pdf", d, claimed{})
+ }()
+ }
+ defer func() {
+ if recover() == nil {
+ t.Error("an unknown conflict policy did not panic")
+ }
+ }()
+ resolveConflict(Move, config.Conflict(len(policies)), "/r/a.pdf", "/r/b.pdf", d, claimed{})
+}