github.com/glide-im/glide@v1.6.0/pkg/subscription/subscription_impl/message_test.go (about) 1 package subscription_impl 2 3 import ( 4 "errors" 5 "github.com/stretchr/testify/assert" 6 "testing" 7 ) 8 9 func TestIsUnknownMessageType(t *testing.T) { 10 type args struct { 11 err error 12 } 13 tests := []struct { 14 name string 15 args args 16 want bool 17 }{ 18 { 19 name: "unknown message type", 20 args: args{ 21 err: errors.New(errUnknownMessageType), 22 }, 23 want: true, 24 }, 25 { 26 name: "unknown message type false", 27 args: args{ 28 err: errors.New(""), 29 }, 30 want: false, 31 }, 32 } 33 for _, tt := range tests { 34 t.Run(tt.name, func(t *testing.T) { 35 assert.Equalf(t, tt.want, IsUnknownMessageType(tt.args.err), "IsUnknownMessageType(%v)", tt.args.err) 36 }) 37 } 38 }