mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
23 lines
505 B
Go
23 lines
505 B
Go
package field_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/facebook/ent/schema/field"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestAnnotation_Merge(t *testing.T) {
|
|
ant := field.Annotation{}
|
|
ant.Merge(field.Annotation{
|
|
StructTag: map[string]string{"foo": "bar"},
|
|
})
|
|
assert.Equal(t, ant.StructTag["foo"], "bar")
|
|
ant.Merge(&field.Annotation{
|
|
StructTag: map[string]string{"foo": "baz", "baz": "qux"},
|
|
})
|
|
assert.Equal(t, ant.StructTag["foo"], "baz")
|
|
assert.Equal(t, ant.StructTag["baz"], "qux")
|
|
}
|