github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/packer/rpc/error_test.go (about)

     1  package rpc
     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  }