Skip to content

Commit

Permalink
Better test for add(empty)
Browse files Browse the repository at this point in the history
  • Loading branch information
myaaaaaaaaa committed Jun 25, 2024
1 parent 5a2e1db commit d3fa5b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/jq.test
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,11 @@ map_values(.+1)
null
[null,120,null,55]

# Real-world use case for add(empty)
.sum = add(.arr[])
{"arr":[]}
{"arr":[],"sum":null}

add({(.[]):1}) | keys
["a","a","b","a","d","b","d","a","d"]
["a","b","d"]
Expand Down

0 comments on commit d3fa5b8

Please sign in to comment.