Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: thedae <[email protected]>
  • Loading branch information
thedae committed Jan 14, 2025
1 parent 64099d3 commit fb3d36f
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions proxy/register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package proxy

import (
"reflect"
"testing"
)

Expand Down Expand Up @@ -52,10 +53,14 @@ func TestNewRegister_responseCombiner_fallbackIfErrored(t *testing.T) {

original := &Response{IsComplete: true, Data: map[string]interface{}{"a": 42}}

result := rc(0, []*Response{original})
result := rc(1, []*Response{{Data: original.Data, IsComplete: original.IsComplete}})

if result != original {
t.Error("unexpected result:", result)
if !reflect.DeepEqual(original.Data, result.Data) {
t.Errorf("unexpected data, want=%+v | have=%+v", original.Data, result.Data)
return
}
if result.IsComplete != original.IsComplete {
t.Errorf("unexpected complete flag, want=%+v | have=%+v", original.IsComplete, result.IsComplete)
return
}
}
Expand All @@ -71,10 +76,14 @@ func TestNewRegister_responseCombiner_fallbackIfUnknown(t *testing.T) {

original := &Response{IsComplete: true, Data: map[string]interface{}{"a": 42}}

result := rc(0, []*Response{original})
result := rc(1, []*Response{{Data: original.Data, IsComplete: original.IsComplete}})

if result != original {
t.Error("unexpected result:", result)
if !reflect.DeepEqual(original.Data, result.Data) {
t.Errorf("unexpected data, want=%+v | have=%+v", original.Data, result.Data)
return
}
if result.IsComplete != original.IsComplete {
t.Errorf("unexpected complete flag, want=%+v | have=%+v", original.IsComplete, result.IsComplete)
return
}
}

0 comments on commit fb3d36f

Please sign in to comment.