Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

path tests: add missing keys to struct literals #300

Merged
merged 1 commit into from Jun 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
56 changes: 28 additions & 28 deletions path_test.go
Expand Up @@ -281,19 +281,19 @@ func TestPath_Merge(t *testing.T) {
expected string
}{
{
"$.c",
`
path: "$.c",
dst: `
a: 1
b: 2
c:
d: 3
e: 4
`,
`
src: `
f: 5
g: 6
`,
`
expected: `
a: 1
b: 2
c:
Expand All @@ -304,20 +304,20 @@ c:
`,
},
{
"$.a.b",
`
path: "$.a.b",
dst: `
a:
b:
- 1
- 2
`,
`
src: `
- 3
- map:
- 4
- 5
`,
`
expected: `
a:
b:
- 1
Expand Down Expand Up @@ -397,30 +397,30 @@ func TestPath_Replace(t *testing.T) {
expected string
}{
{
"$.a",
`
path: "$.a",
dst: `
a: 1
b: 2
`,
`3`,
`
src: `3`,
expected: `
a: 3
b: 2
`,
},
{
"$.b",
`
path: "$.b",
dst: `
b: 1
c: 2
`,
`
src: `
d: e
f:
g: h
i: j
`,
`
expected: `
b:
d: e
f:
Expand All @@ -430,15 +430,15 @@ c: 2
`,
},
{
"$.a.b[0]",
`
path: "$.a.b[0]",
dst: `
a:
b:
- hello
c: 2
`,
`world`,
`
src: `world`,
expected: `
a:
b:
- world
Expand All @@ -447,8 +447,8 @@ c: 2
},

{
"$.books[*].author",
`
path: "$.books[*].author",
dst: `
books:
- name: book_a
author: none
Expand All @@ -462,8 +462,8 @@ pictures:
building:
author: none
`,
`ken`,
`
src: `ken`,
expected: `
books:
- name: book_a
author: ken
Expand All @@ -479,8 +479,8 @@ building:
`,
},
{
"$..author",
`
path: "$..author",
dst: `
books:
- name: book_a
author: none
Expand All @@ -494,8 +494,8 @@ pictures:
building:
author: none
`,
`ken`,
`
src: `ken`,
expected: `
books:
- name: book_a
author: ken
Expand Down