~rbn/neinp

ref: 062a107b140085acd6c48867e4328fb3f3466a87 neinp/qid/qid_test.go -rw-r--r-- 341 bytes
062a107bRuben Schuller use custom go.rbn.im import path 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 qid // import "go.rbn.im/neinp/qid"

import (
	"bytes"
	"testing"
)

func TestQidEncodeDecode(t *testing.T) {
	var buf bytes.Buffer
	a := &Qid{1, 2, 3}
	_, err := a.Encode(&buf)
	if err != nil {
		t.Error(err)
	}

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

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