compression_method_test.go 506 B

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