mirror of
https://github.com/mikefarah/yq.git
synced 2025-02-05 07:57:11 +00:00
#607 Fix string value with spaces error
This commit is contained in:
parent
7849232255
commit
540d4953f5
@ -12,6 +12,13 @@ var assignOperatorScenarios = []expressionScenario{
|
|||||||
"D0, P[], ()::a:\n b: cat\nx: frog\n",
|
"D0, P[], ()::a:\n b: cat\nx: frog\n",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
description: "Create yaml file with value with spaces",
|
||||||
|
expression: `.a.b = "cat" | .x = "frog jumps"`,
|
||||||
|
expected: []string{
|
||||||
|
"D0, P[], ()::a:\n b: cat\nx: frog jumps\n",
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
description: "Update node to be the child value",
|
description: "Update node to be the child value",
|
||||||
document: `{a: {b: {g: foof}}}`,
|
document: `{a: {b: {g: foof}}}`,
|
||||||
|
@ -250,7 +250,7 @@ func initLexer() (*lex.Lexer, error) {
|
|||||||
lexer.Add([]byte(`[Nn][Uu][Ll][Ll]`), nullValue())
|
lexer.Add([]byte(`[Nn][Uu][Ll][Ll]`), nullValue())
|
||||||
lexer.Add([]byte(`~`), nullValue())
|
lexer.Add([]byte(`~`), nullValue())
|
||||||
|
|
||||||
lexer.Add([]byte(`"[^ "]*"`), stringValue(true))
|
lexer.Add([]byte(`"[^"]*"`), stringValue(true))
|
||||||
|
|
||||||
lexer.Add([]byte(`\[\]`), literalToken(SplatOrEmptyCollect, true))
|
lexer.Add([]byte(`\[\]`), literalToken(SplatOrEmptyCollect, true))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user