Ember+ loadable plugin
Source
0x00, 0x60, 0x80, 0x6b, 0x80, 0xa0, 0x80, 0x74, 0x80, 0xa0, 0x80, 0x0d, 0x00, 0xa2, 0x80, 0x64, 0x80,
/*
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
package asn1
import (
"bytes"
"testing"
"github.com/google/go-cmp/cmp"
)
func TestEncoder_GetData(t *testing.T) {
t.Parallel()
type fields struct {
data *bytes.Buffer
}
tests := []struct {
name string
fields fields
want []byte
}{
{
"+valid",
fields{bytes.NewBuffer([]byte{0x00, 0x01, 0x02})},
[]byte{0x00, 0x01, 0x02},
},
}
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
c := &Encoder{
data: tt.fields.data,
}
got := c.GetData()
if diff := cmp.Diff(tt.want, got); diff != "" {
t.Fatalf("Encoder.GetData() = %s", diff)
}
})
}
}
func TestEncoder_WriteRequest(t *testing.T) {
t.Parallel()
type fields struct {
data *bytes.Buffer