27 lines
322 B
Go
27 lines
322 B
Go
package errs
|
|
|
|
import (
|
|
"bytes"
|
|
"reflect"
|
|
"testing"
|
|
)
|
|
|
|
func TestError_Simple(t *testing.T) {
|
|
e := Archived
|
|
|
|
b := &bytes.Buffer{}
|
|
|
|
if err := e.Write(b); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
e2 := &Error{}
|
|
if err := e2.Read(b); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
if !reflect.DeepEqual(*e, *e2) {
|
|
t.Fatal("not equal")
|
|
}
|
|
}
|