Added string trim operator

This commit is contained in:
Mike Farah
2022-08-08 13:35:57 +10:00
parent 989dabac5a
commit a696dceea4
5 changed files with 53 additions and 0 deletions
+11
View File
@@ -47,6 +47,17 @@ var stringsOperatorScenarios = []expressionScenario{
"D0, P[], (!!str)::cat; meow; 1; ; true\n",
},
},
{
description: "Trim strings",
document: `[" cat", "dog ", " cow cow ", horse]`,
expression: `.[] | trim`,
expected: []string{
"D0, P[0], (!!str)::cat\n",
"D0, P[1], (!!str)::dog\n",
"D0, P[2], (!!str)::cow cow\n",
"D0, P[3], (!!str)::horse\n",
},
},
{
skipDoc: true,
document: `[!horse cat, !goat meow, !frog 1, null, true]`,