isle/go/yamlutil/ordered_map_test.go

21 lines
304 B
Go
Raw Normal View History

package yamlutil
import (
"testing"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v3"
)
func TestOrderedMap(t *testing.T) {
m := OrderedMap[string, int]{
"a": 1,
"b": 2,
"c": 3,
}
b, err := yaml.Marshal(m)
assert.NoError(t, err)
assert.Equal(t, "a: 1\nb: 2\nc: 3\n", string(b))
}