Added another test

This commit is contained in:
Mike Farah 2021-12-01 09:14:18 +11:00
parent 1c50ae4e6a
commit 54b355bffb

View File

@ -116,9 +116,11 @@ var collectObjectOperatorScenarios = []expressionScenario{
{ {
skipDoc: true, skipDoc: true,
document: `{name: Mike, pets: {cows: [apl, bba]}}`, document: `{name: Mike, pets: {cows: [apl, bba]}}`,
document2: `{name: Rosey, pets: {sheep: [frog, meow]}}`,
expression: `{"a":.name, "b":.pets}`, expression: `{"a":.name, "b":.pets}`,
expected: []string{ expected: []string{
"D0, P[], (!!map)::a: Mike\nb: {cows: [apl, bba]}\n", "D0, P[], (!!map)::a: Mike\nb: {cows: [apl, bba]}\n",
"D0, P[], (!!map)::a: Rosey\nb: {sheep: [frog, meow]}\n",
}, },
}, },
{ {
@ -129,6 +131,13 @@ var collectObjectOperatorScenarios = []expressionScenario{
"D0, P[], (!!map)::wrap: frog\n", "D0, P[], (!!map)::wrap: frog\n",
}, },
}, },
{
skipDoc: true,
expression: `{"wrap": "frog", "bing": "bong"}`,
expected: []string{
"D0, P[], (!!map)::wrap: frog\nbing: bong\n",
},
},
{ {
skipDoc: true, skipDoc: true,
document: `{name: Mike}`, document: `{name: Mike}`,