This commit is contained in:
2026-06-23 05:02:15 +08:00
commit e6f1776d4f
264 changed files with 54215 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package cc
import (
"errors"
"testing"
)
func TestClaudeTimeoutErrorUnwrapsToClaudeError(t *testing.T) {
err := error(&ClaudeTimeoutError{ClaudeError{Msg: "timeout", Stderr: "boom"}})
var ce *ClaudeError
if !errors.As(err, &ce) {
t.Fatal("errors.As(*ClaudeError) should match a *ClaudeTimeoutError")
}
if ce.Msg != "timeout" {
t.Errorf("unwrapped Msg = %q, want %q", ce.Msg, "timeout")
}
var te *ClaudeTimeoutError
if !errors.As(err, &te) {
t.Fatal("errors.As(*ClaudeTimeoutError) should still match")
}
}