mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 00:54:51 +08:00
Fixed bug in splice operator #1511
This commit is contained in:
@@ -55,6 +55,24 @@ var sliceArrayScenarios = []expressionScenario{
|
||||
"D0, P[1], (!!seq)::- banana\n- grape\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "second index beyond array clamps",
|
||||
document: `[cat]`,
|
||||
expression: `.[:3]`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!seq)::- cat\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "first index beyond array returns nothing",
|
||||
document: `[cat]`,
|
||||
expression: `.[3:]`,
|
||||
expected: []string{
|
||||
"D0, P[], (!!seq)::[]\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
document: `[[cat, dog, frog, cow], [apple, banana, grape, mango]]`,
|
||||
|
||||
Reference in New Issue
Block a user