~rbn/neinp

ref: f0b91981560c6d7f112692b0479d8d28cc062ba7 neinp/message/error_test.go -rw-r--r-- 368 bytes
f0b91981Ruben Schuller add build badge 2 years 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 "go.rbn.im/neinp/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()
	}
}