Skip to content

Commit

Permalink
Add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
TomWright committed Oct 18, 2023
1 parent a7cc397 commit 4c0c899
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions internal/command/select_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,30 @@ octal: 8`)),
nil,
))

t.Run("OrDefaultLookup", runTest(
[]string{"-r", "json", "all().orDefault(locale,bookCategory)"},
[]byte(`{
"-LCr5pXw_fN32IqNDr4E": {
"bookCategory": "poetry",
"locale": "en-us",
"mediaType": "book",
"publisher": "Pomelo Books",
"title": "Sound Waves",
"type": "poetry"
},
"-LDDHjkdY0306fZdvhEQ": {
"ISBN13": "978-1534402966",
"bookCategory": "fiction",
"title": "What Can You Do with a Toolbox?",
"type": "picturebook"
}
}`),
newline([]byte(`"en-us"
"fiction"`)),
nil,
nil,
))

t.Run("Issue364 - CSV root element part 1", runTest(
[]string{"-r", "csv", "-w", "csv", "all().merge()"},
[]byte(`A,B,C
Expand Down

0 comments on commit 4c0c899

Please sign in to comment.