github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/internal/grpcwrapper/rawtopic/rawtopiccommon/codec_test.go (about) 1 package rawtopiccommon 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 ) 8 9 func TestSupportedCodecsEquals(t *testing.T) { 10 tests := []struct { 11 first, second SupportedCodecs 12 result bool 13 }{ 14 { 15 nil, 16 nil, 17 true, 18 }, 19 { 20 nil, 21 SupportedCodecs{}, 22 true, 23 }, 24 { 25 SupportedCodecs{CodecGzip, CodecRaw}, 26 SupportedCodecs{CodecGzip, CodecRaw}, 27 true, 28 }, 29 { 30 SupportedCodecs{CodecRaw, CodecGzip}, 31 SupportedCodecs{CodecGzip, CodecRaw}, 32 true, 33 }, 34 { 35 nil, 36 SupportedCodecs{CodecRaw}, 37 false, 38 }, 39 { 40 SupportedCodecs{CodecGzip}, 41 SupportedCodecs{CodecRaw}, 42 false, 43 }, 44 } 45 46 for _, test := range tests { 47 t.Run("", func(t *testing.T) { 48 require.Equal(t, test.result, test.first.IsEqualsTo(test.second)) 49 require.Equal(t, test.result, test.second.IsEqualsTo(test.first)) 50 }) 51 } 52 }