| 1 | package acp |
| 2 | |
| 3 | import "testing" |
| 4 | |
| 5 | func TestLoadedGoalDraftModeRequiresMissingGoal(t *testing.T) { |
| 6 | if loadedGoalDraftMode("finish the restored target") { |
| 7 | t.Fatal("an existing stopped/disarmed goal was treated as a new-goal draft") |
| 8 | } |
| 9 | if !loadedGoalDraftMode(" ") { |
| 10 | t.Fatal("a session without a goal must keep draft mode for the next prompt") |
| 11 | } |
| 12 | } |
| 13 | |
| 14 | func TestSelectingGoalModeDoesNotReplaceExistingLifecycle(t *testing.T) { |
| 15 | for _, objective := range []string{"restored active goal", "blocked goal", "paused goal", "completed goal"} { |
| 16 | if selectedGoalDraftMode(sessionModeGoal, objective) { |
| 17 | t.Fatalf("Goal mode treated existing objective %q as a draft", objective) |
| 18 | } |
| 19 | } |
| 20 | if !selectedGoalDraftMode(sessionModeGoal, "") { |
| 21 | t.Fatal("Goal mode without a lifecycle did not arm a new-goal draft") |
| 22 | } |
| 23 | if selectedGoalDraftMode(sessionModePlan, "") { |
| 24 | t.Fatal("Plan mode armed a Goal draft") |
| 25 | } |
| 26 | } |
| 27 |