~rbn/neinp

ref: 280ca11dc4f314d4bb506de2f219eb70dd959227 neinp/message/error_test.go -rw-r--r-- 332 bytes
280ca11dRuben Schuller update go.mod 1 year, 2 months ago
                                                                                
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
package message

import (
	"bytes"
	"testing"
)

func TestRErrorEncodeDecode(t *testing.T) {
	var buf bytes.Buffer
	a := &RError{Ename: "deadbeef"}
	_, err := a.encode(&buf)
	if err != nil {
		t.Error(err)
	}

	b := &RError{}
	_, err = b.decode(&buf)
	if err != nil {
		t.Error(err)
	}

	if *a != *b {
		t.Log(a, b)
		t.Fail()
	}
}