2013-05-09 16:59:33 -04:00
|
|
|
package rpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestBasicError_ImplementsError(t *testing.T) {
|
2013-10-16 23:04:57 -04:00
|
|
|
var _ error = new(BasicError)
|
2013-05-09 16:59:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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())
|
|
|
|
}
|
2013-05-09 16:59:33 -04:00
|
|
|
}
|