packer-cn/packer/rpc/error_test.go

20 lines
323 B
Go
Raw Normal View History

package rpc
import (
"errors"
"testing"
)
func TestBasicError_ImplementsError(t *testing.T) {
2013-10-16 23:04:57 -04:00
var _ error = new(BasicError)
}
func TestBasicError_MatchesMessage(t *testing.T) {
err := errors.New("foo")
wrapped := NewBasicError(err)
2013-10-16 23:04:57 -04:00
if wrapped.Error() != err.Error() {
t.Fatalf("bad: %#v", wrapped.Error())
}
}