2024-09-24 11:40:28 -04:00
|
|
|
package meta_test
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
2024-10-24 14:39:39 +02:00
|
|
|
|
|
|
|
|
"github.com/ucan-wg/go-ucan/pkg/meta"
|
2024-09-24 11:40:28 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
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{})
|
2024-11-12 13:05:48 +01:00
|
|
|
require.Error(t, err)
|
2024-09-24 11:40:28 -04:00
|
|
|
})
|
|
|
|
|
}
|