yq/pkg/yqlib/operator_array_to_map_test.go

24 lines
468 B
Go
Raw Permalink Normal View History

2022-11-08 02:40:00 +00:00
package yqlib
import (
"testing"
)
var arrayToMapScenarios = []expressionScenario{
{
description: "Simple example",
document: `cool: [null, null, hello]`,
expression: `.cool |= array_to_map`,
expected: []string{
"D0, P[], (!!map)::cool:\n 2: hello\n",
2022-11-08 02:40:00 +00:00
},
},
}
func TestArrayToMapScenarios(t *testing.T) {
for _, tt := range arrayToMapScenarios {
testScenario(t, &tt)
}
documentOperatorScenarios(t, "array-to-map", arrayToMapScenarios)
}