2018-04-26 07:14:51 -07:00
|
|
|
package types
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAppendTags(t *testing.T) {
|
2018-05-09 15:47:28 -07:00
|
|
|
a := NewTags("a", []byte("1"))
|
|
|
|
b := NewTags("b", []byte("2"))
|
2018-05-10 08:14:46 -07:00
|
|
|
c := a.AppendTags(b)
|
2018-04-26 07:14:51 -07:00
|
|
|
require.Equal(t, c, Tags{MakeTag("a", []byte("1")), MakeTag("b", []byte("2"))})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestEmptyTags(t *testing.T) {
|
|
|
|
a := EmptyTags()
|
|
|
|
require.Equal(t, a, Tags{})
|
|
|
|
}
|
|
|
|
|
2018-05-09 15:47:28 -07:00
|
|
|
func TestNewTags(t *testing.T) {
|
|
|
|
b := NewTags("a", []byte("1"))
|
2018-04-26 07:14:51 -07:00
|
|
|
require.Equal(t, b, Tags{MakeTag("a", []byte("1"))})
|
|
|
|
}
|