mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 02:03:24 +08:00
Can add string to scalars in any order #1234
This commit is contained in:
@@ -199,6 +199,24 @@ var addOperatorScenarios = []expressionScenario{
|
||||
"D0, P[], (doc)::{a: catmeow, b: meow}\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "String concatenation - str + int",
|
||||
skipDoc: true,
|
||||
document: `{a: !cool cat, b: meow}`,
|
||||
expression: `.a + 3`,
|
||||
expected: []string{
|
||||
"D0, P[a], (!cool)::cat3\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "String concatenation - int + str",
|
||||
skipDoc: true,
|
||||
document: `{a: !cool cat, b: meow}`,
|
||||
expression: `3 + .a`,
|
||||
expected: []string{
|
||||
"D0, P[], (!cool)::3cat\n",
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Number addition - float",
|
||||
subdescription: "If the lhs or rhs are floats then the expression will be calculated with floats.",
|
||||
|
||||
Reference in New Issue
Block a user