| 12345678910111213141516171819202122232425 |
- // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
- // SPDX-License-Identifier: MIT
- package extension
- import (
- "errors"
- "testing"
- )
- func TestExtensions(t *testing.T) {
- t.Run("Zero", func(t *testing.T) {
- extensions, err := Unmarshal([]byte{})
- if err != nil || len(extensions) != 0 {
- t.Fatal("Failed to decode zero extensions")
- }
- })
- t.Run("Invalid", func(t *testing.T) {
- extensions, err := Unmarshal([]byte{0x00})
- if !errors.Is(err, errBufferTooSmall) || len(extensions) != 0 {
- t.Fatal("Failed to error on invalid extension")
- }
- })
- }
|