11
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user