mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-05 09:04:58 +08:00
fix: preserve TOML inline table array scope (#2694)
Co-authored-by: cyphercodes <cyphercodes@users.noreply.github.com>
This commit is contained in:
co-authored by
cyphercodes
parent
cb97935554
commit
d1dff4661b
@@ -237,6 +237,22 @@ my-other-feature = []
|
||||
my-feature = ["my-other-feature"]
|
||||
`
|
||||
|
||||
var issue2688SampleToml = `[project]
|
||||
name = "some-project"
|
||||
version = "0.5.1"
|
||||
authors = [{name = "Author", email = "author@example.com"}]
|
||||
license = { file = "LICENSE" }
|
||||
readme = "README.md"
|
||||
`
|
||||
|
||||
var issue2688SampleExpected = `[project]
|
||||
name = "some-project"
|
||||
version = "0.5.2"
|
||||
authors = [{ name = "Author", email = "author@example.com" }]
|
||||
license = { file = "LICENSE" }
|
||||
readme = "README.md"
|
||||
`
|
||||
|
||||
var rtSampleTable = `var = "x"
|
||||
|
||||
[owner.contact]
|
||||
@@ -726,6 +742,14 @@ var tomlScenarios = []formatScenario{
|
||||
expected: "[arg]\nhello = \"foo\"\n",
|
||||
scenarioType: "encode-json",
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Issue 2688: inline table arrays do not change following table scope",
|
||||
input: issue2688SampleToml,
|
||||
expression: `.project.version = "0.5.2"`,
|
||||
expected: issue2688SampleExpected,
|
||||
scenarioType: "roundtrip",
|
||||
},
|
||||
{
|
||||
skipDoc: true,
|
||||
description: "Roundtrip: key with special characters in inline table",
|
||||
|
||||
Reference in New Issue
Block a user