github.com/pion/dtls/v2@v2.2.12/pkg/protocol/compression_method_test.go (about) 1 // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly> 2 // SPDX-License-Identifier: MIT 3 4 package protocol 5 6 import ( 7 "errors" 8 "testing" 9 ) 10 11 func TestDecodeCompressionMethods(t *testing.T) { 12 testCases := []struct { 13 buf []byte 14 result []*CompressionMethod 15 err error 16 }{ 17 {[]byte{}, nil, errBufferTooSmall}, 18 } 19 20 for _, testCase := range testCases { 21 _, err := DecodeCompressionMethods(testCase.buf) 22 if !errors.Is(err, testCase.err) { 23 t.Fatal("Unexpected error", err) 24 } 25 } 26 }