fix(tests): correct errors.Is argument order and revert unrelated rename
- Fix reversed arguments in errors.Is calls in tests - Revert cp -> copy rename in codex_provider.go to keep PR focused
This commit is contained in:
parent
4e68cf5b1e
commit
9929003f69
3 changed files with 4 additions and 4 deletions
|
|
@ -91,8 +91,8 @@ func (p *CodexProvider) Chat(ctx context.Context, messages []Message, tools []To
|
||||||
if evt.Type == "response.completed" || evt.Type == "response.failed" || evt.Type == "response.incomplete" {
|
if evt.Type == "response.completed" || evt.Type == "response.failed" || evt.Type == "response.incomplete" {
|
||||||
evtResp := evt.Response
|
evtResp := evt.Response
|
||||||
if evtResp.ID != "" {
|
if evtResp.ID != "" {
|
||||||
cp := evtResp
|
copy := evtResp
|
||||||
resp = &cp
|
resp = ©
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -293,7 +293,7 @@ func TestFailoverError_ErrorString(t *testing.T) {
|
||||||
func TestFailoverError_Unwrap(t *testing.T) {
|
func TestFailoverError_Unwrap(t *testing.T) {
|
||||||
inner := errors.New("inner error")
|
inner := errors.New("inner error")
|
||||||
fe := &FailoverError{Reason: FailoverTimeout, Wrapped: inner}
|
fe := &FailoverError{Reason: FailoverTimeout, Wrapped: inner}
|
||||||
if !errors.Is(inner, fe.Unwrap()) {
|
if !errors.Is(fe.Unwrap(), inner) {
|
||||||
t.Error("Unwrap should return wrapped error")
|
t.Error("Unwrap should return wrapped error")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ func TestMessageTool_Execute_SendFailure(t *testing.T) {
|
||||||
if result.Err == nil {
|
if result.Err == nil {
|
||||||
t.Error("Expected Err to be set")
|
t.Error("Expected Err to be set")
|
||||||
}
|
}
|
||||||
if !errors.Is(sendErr, result.Err) {
|
if !errors.Is(result.Err, sendErr) {
|
||||||
t.Errorf("Expected Err to be sendErr, got %v", result.Err)
|
t.Errorf("Expected Err to be sendErr, got %v", result.Err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue