aboutsummaryrefslogtreecommitdiff
path: root/file/file_test.go
blob: d34da2c8d37e0a26877066e72c35405d14579d2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package file

import (
	"bytes"
	"testing"
)

func TestSig(t *testing.T) {
	b := &Block{
		Comment: "comment",
		Bytes:   []byte{'t', 'e', 's', 't'},
	}
	b2, err := Decode(EncodeToMemory(b))
	if err != nil {
		t.Error(err)
	}
	if b.Comment != b2.Comment || !bytes.Equal(b.Bytes, b2.Bytes) {
		t.Errorf("got %v, want %v", b2, b)
	}
}