refactor: чистка мёртвого кода, лимит ходов D3, HTML-экранирование и UTF-8 обрезка в Telegram
Some checks failed
CI / test (pull_request) Failing after 34s
CI / build-and-package (amd64, linux) (pull_request) Successful in 34s
CI / build-and-package (amd64, windows) (pull_request) Successful in 36s

This commit is contained in:
ki.sagidullin
2026-08-18 23:13:04 +05:00
parent 7eb3a0292c
commit 1459670ce9
13 changed files with 138 additions and 190 deletions

View File

@@ -93,26 +93,6 @@ func TestRun_ContextCancel(t *testing.T) {
}
}
// TestResumeDev_Fallback: resume (sessionID) "падает" rc!=0 только когда самого
// сервера нет; в фейке такого нет, поэтому проверяем, что при успехе
// fallback не срабатывает и таймаут не выставляется.
func TestResumeDev_NoFallbackOnSuccess(t *testing.T) {
dir := t.TempDir()
f := &fakeAPIServer{
verdictParts: []part{{Type: "text", Text: "ok"}},
}
p, _ := fakePool(t, f, dir)
r := &Runner{Pool: p, PollInterval: 5 * time.Millisecond}
res, timedOut := r.ResumeDev(context.Background(), "task", dir, "lost-session")
if timedOut {
t.Error("timedOut = true, want false (успех не должен считаться таймаутом)")
}
if res.RC != 0 {
t.Errorf("RC = %d, want 0", res.RC)
}
}
func contains(s, sub string) bool {
return len(s) >= len(sub) && (s == sub || len(s) > 0 && indexOf(s, sub) >= 0)
}