mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 05:38:04 +00:00
13d1bbb45f
Remove dependency on yaml.Node for internal AST representation. Yaml decoder is now just another decoder.
24 lines
468 B
Go
24 lines
468 B
Go
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",
|
|
},
|
|
},
|
|
}
|
|
|
|
func TestArrayToMapScenarios(t *testing.T) {
|
|
for _, tt := range arrayToMapScenarios {
|
|
testScenario(t, &tt)
|
|
}
|
|
documentOperatorScenarios(t, "array-to-map", arrayToMapScenarios)
|
|
}
|