mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-01 14:14:52 +08:00
Fixed select bug (#958)
This commit is contained in:
@@ -5,6 +5,28 @@ import (
|
||||
)
|
||||
|
||||
var selectOperatorScenarios = []expressionScenario{
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `cat`,
|
||||
expression: `select(false, true)`,
|
||||
expected: []string{
|
||||
"D0, P[], (doc)::cat\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `cat`,
|
||||
expression: `select(true, false)`,
|
||||
expected: []string{
|
||||
"D0, P[], (doc)::cat\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `cat`,
|
||||
expression: `select(false)`,
|
||||
expected: []string{},
|
||||
},
|
||||
{
|
||||
description: "Select elements from array",
|
||||
document: `[cat,goat,dog]`,
|
||||
|
||||
Reference in New Issue
Block a user