/usr/share/gocode/src/github.com/Shopify/sarama/sync_group_response_test.go is in golang-github-shopify-sarama-dev 1.9.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | package sarama
import (
"reflect"
"testing"
)
var (
syncGroupResponseNoError = []byte{
0x00, 0x00, // No error
0, 0, 0, 3, 0x01, 0x02, 0x03, // Member assignment data
}
syncGroupResponseWithError = []byte{
0, 27, // ErrRebalanceInProgress
0, 0, 0, 0, // No member assignment data
}
)
func TestSyncGroupResponse(t *testing.T) {
var response *SyncGroupResponse
response = new(SyncGroupResponse)
testDecodable(t, "no error", response, syncGroupResponseNoError)
if response.Err != ErrNoError {
t.Error("Decoding Err failed: no error expected but found", response.Err)
}
if !reflect.DeepEqual(response.MemberAssignment, []byte{0x01, 0x02, 0x03}) {
t.Error("Decoding MemberAssignment failed, found:", response.MemberAssignment)
}
response = new(SyncGroupResponse)
testDecodable(t, "no error", response, syncGroupResponseWithError)
if response.Err != ErrRebalanceInProgress {
t.Error("Decoding Err failed: ErrRebalanceInProgress expected but found", response.Err)
}
if !reflect.DeepEqual(response.MemberAssignment, []byte{}) {
t.Error("Decoding MemberAssignment failed, found:", response.MemberAssignment)
}
}
|