OSDN Git Service

add package
[bytom/vapor.git] / vendor / github.com / hashicorp / go-plugin / error_test.go
1 package plugin
2
3 import (
4         "errors"
5         "testing"
6 )
7
8 func TestBasicError_ImplementsError(t *testing.T) {
9         var _ error = new(BasicError)
10 }
11
12 func TestBasicError_MatchesMessage(t *testing.T) {
13         err := errors.New("foo")
14         wrapped := NewBasicError(err)
15
16         if wrapped.Error() != err.Error() {
17                 t.Fatalf("bad: %#v", wrapped.Error())
18         }
19 }
20
21 func TestNewBasicError_nil(t *testing.T) {
22         r := NewBasicError(nil)
23         if r != nil {
24                 t.Fatalf("bad: %#v", r)
25         }
26 }