Commit 8f901c3635

8f901c3635249470f44d41ec28059217ab87d6ac

parent: 6bee23b811

Unsigned

Wraient <wraient.911@gmail.com> · 2026-07-22 20:55 UTC

Fix recovery Quit to return quit without os.Exit in tests

promptEpisodeLinkFailureRecovery maps Quit to \"quit\" for callers to
handle, instead of calling ExitCurd (which aborts unit tests).

Layout: unified · split

internal/episode_link_recovery_test.go +2 −2
@@ -73,8 +73,8 @@ func TestPromptEpisodeLinkFailureRecoveryMapsExitKeysToBack(t *testing.T) {
7373 withPromptSelect(t, func(options []SelectionOption) (SelectionOption, error) {
7474 return SelectionOption{Key: "-1", Label: "Quit"}, nil
7575 })
76 if got := promptEpisodeLinkFailureRecovery(cfg, anime, errors.New("fail"), true); got != "back" {
77 t.Fatalf("expected back for -1, got %q", got)
76 if got := promptEpisodeLinkFailureRecovery(cfg, anime, errors.New("fail"), true); got != "quit" {
77 t.Fatalf("expected quit for -1, got %q", got)
7878 }
7979}
8080
internal/provider_mapping.go +1 −2
@@ -893,8 +893,7 @@ func promptEpisodeLinkFailureRecovery(config *CurdConfig, anime *Anime, lastErr
893893 }
894894 selected = NormalizeSelectionKey(selected)
895895 if SelectionMeansQuit(selected) {
896 ExitCurd(nil)
897 return "back"
896 return "quit"
898897 }
899898 if SelectionMeansBack(selected) || selected.Key == "" {
900899 return "back"