1
0
mirror of https://github.com/TomWright/dasel.git synced 2022-05-22 02:32:45 +03:00

Add an output formatter test

This commit is contained in:
Tom Wright
2021-08-11 09:06:51 +01:00
parent 56f6f1a3df
commit 550e1e9007

View File

@@ -132,6 +132,23 @@ Jim
---
Frank`,
))
t.Run("QueryMultipleBadSelector", testFormatNode(
map[string]interface{}{
"users": []map[string]interface{}{
{
"name": "Tom",
},
{
"name": "Jim",
},
{
"name": "Frank",
},
},
},
`{{ queryMultiple ".users.[*].names" | format "{{ . }}{{ if not isLast }}{{ newline }}{{ end }}" }}`,
``,
))
}
func TestFormatNodes(t *testing.T) {