Files
ucan/pkg/meta/meta_test.go
Michael Muré 6d0fbd4d5a minor cleanups
2024-10-24 14:46:01 +02:00

25 lines
499 B
Go

package meta_test
import (
"testing"
"github.com/stretchr/testify/require"
"gotest.tools/v3/assert"
"github.com/ucan-wg/go-ucan/pkg/meta"
)
func TestMeta_Add(t *testing.T) {
t.Parallel()
type Unsupported struct{}
t.Run("error if not primative or Node", func(t *testing.T) {
t.Parallel()
err := (&meta.Meta{}).Add("invalid", &Unsupported{})
require.ErrorIs(t, err, meta.ErrUnsupported)
assert.ErrorContains(t, err, "*github.com/ucan-wg/go-ucan/pkg/meta_test.Unsupported")
})
}