github.com/mailru/activerecord@v1.12.2/internal/pkg/arerror/arerror_b_test.go (about)

     1  package arerror
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestErrorBase(t *testing.T) {
     8  	type args struct {
     9  		errStruct interface{}
    10  	}
    11  	tests := []struct {
    12  		name string
    13  		args args
    14  		want string
    15  	}{
    16  		{
    17  			name: "simple error",
    18  			args: args{
    19  				errStruct: &ErrGeneratorPkg{
    20  					Name: "TestError",
    21  					Err:  ErrGeneratorBackendUnknown,
    22  				},
    23  			},
    24  			want: `ErrGeneratorPkg Name: ` + "`TestError`" + `; 
    25  	backend unknown`,
    26  		},
    27  	}
    28  	for _, tt := range tests {
    29  		t.Run(tt.name, func(t *testing.T) {
    30  			if got := ErrorBase(tt.args.errStruct); got != tt.want {
    31  				t.Errorf("ErrorBase() = %v, want %v", got, tt.want)
    32  			}
    33  		})
    34  	}
    35  }