Added join strings operator

This commit is contained in:
Mike Farah
2021-02-11 10:58:40 +11:00
parent 626e9cacaf
commit d21c94cf4f
5 changed files with 95 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
package yqlib
import (
"testing"
)
var stringsOperatorScenarios = []expressionScenario{
{
description: "Join strings",
document: `[cat, meow, 1, null, true]`,
expression: `join("; ")`,
expected: []string{
"D0, P[], (!!str)::cat; meow; 1; ; true\n",
},
},
}
func TestStringsOperatorScenarios(t *testing.T) {
for _, tt := range stringsOperatorScenarios {
testScenario(t, &tt)
}
documentScenarios(t, "String Operators", stringsOperatorScenarios)
}