aboutsummaryrefslogtreecommitdiff
path: root/sig/sig_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'sig/sig_test.go')
-rw-r--r--sig/sig_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/sig/sig_test.go b/sig/sig_test.go
new file mode 100644
index 0000000..06be3c0
--- /dev/null
+++ b/sig/sig_test.go
@@ -0,0 +1,20 @@
+package sig
+
+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)
+ }
+}