github.com/pion/dtls/v2@v2.2.12/pkg/protocol/handshake/cipher_suite_test.go (about)

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