File: sasl_handshake_response_test.go

package info (click to toggle)
golang-github-ibm-sarama 1.45.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,964 kB
  • sloc: makefile: 35; sh: 19
file content (25 lines) | stat: -rw-r--r-- 601 bytes parent folder | download
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
//go:build !functional

package sarama

import (
	"errors"
	"testing"
)

var saslHandshakeResponse = []byte{
	0x00, 0x00,
	0x00, 0x00, 0x00, 0x01,
	0x00, 0x03, 'f', 'o', 'o',
}

func TestSaslHandshakeResponse(t *testing.T) {
	response := new(SaslHandshakeResponse)
	testVersionDecodable(t, "no error", response, saslHandshakeResponse, 0)
	if !errors.Is(response.Err, ErrNoError) {
		t.Error("Decoding error failed: no error expected but found", response.Err)
	}
	if response.EnabledMechanisms[0] != "foo" {
		t.Error("Decoding error failed: expected 'foo' but found", response.EnabledMechanisms)
	}
}