func (s *TrailSuite) TestConversion(c *C) {
	type TestCase struct {
		Error     error
		Message   string
		Predicate func(error) bool
	}
	testCases := []TestCase{
		{
			Error:     trace.AccessDenied("access denied"),
			Predicate: trace.IsAccessDenied,
		},
		{
			Error:     trace.ConnectionProblem(nil, "problem"),
			Predicate: trace.IsConnectionProblem,
		},
		{
			Error:     trace.NotFound("not found"),
			Predicate: trace.IsNotFound,
		},
		{
			Error:     trace.BadParameter("bad parameter"),
			Predicate: trace.IsBadParameter,
		},
		{
			Error:     trace.CompareFailed("compare failed"),
			Predicate: trace.IsCompareFailed,
		},
		{
			Error:     trace.AccessDenied("denied"),
			Predicate: trace.IsAccessDenied,
		},
		{
			Error:     trace.LimitExceeded("exceeded"),
			Predicate: trace.IsLimitExceeded,
		},
		{
			Error:     trace.NotImplemented("not implemented"),
			Predicate: trace.IsNotImplemented,
		},
	}
	for i, tc := range testCases {
		comment := Commentf("test case #v", i+1)
		grpcError := ToGRPC(tc.Error)
		c.Assert(grpc.ErrorDesc(grpcError), Equals, tc.Error.Error(), comment)
		out := FromGRPC(grpcError)
		c.Assert(tc.Predicate(out), Equals, true, comment)
		c.Assert(line(trace.DebugReport(out)), Matches, ".*trail_test.go.*")
		c.Assert(line(trace.DebugReport(out)), Not(Matches), ".*trail.go.*")
	}
}
TestConversion makes sure we convert all trace supported errors
to and back from GRPC codes
package trail
import (
	"io"
	"strings"
	"testing"
	"github.com/gravitational/trace"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/metadata"
	"google.golang.org/grpc/status"
	. "gopkg.in/check.v1"
)
func TestTrail(t *testing.T) { TestingT(t) }
type TrailSuite struct {
}
var _ = Suite(&TrailSuite{})