mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-09 16:09:07 +00:00
Fix pre-existing test-expectation and formatting nits in TOML package
Two unrelated pre-existing issues in pkg/yqlib, split out from the comment-fidelity work: - The go-toml/v2 2.4.2 bump (#2762) renamed the single-line unterminated-string parser error from `basic string not terminated by "` to `unterminated basic string`, but the decode-error scenario still asserted the old text, so TestTomlScenarios failed. Update it to match. - gofmt: a comment line in encoder_toml.go was indented with spaces.
This commit is contained in:
parent
e2f1d5ccf7
commit
ed2ad17954
@ -677,7 +677,7 @@ func (te *tomlEncoder) colorizeToml(input []byte) []byte {
|
|||||||
|
|
||||||
// Table sections - [section] or [[array]]
|
// Table sections - [section] or [[array]]
|
||||||
// Only treat '[' as a table section if it appears at the start of the line
|
// Only treat '[' as a table section if it appears at the start of the line
|
||||||
// (possibly after whitespace). This avoids incorrectly colouring inline arrays like
|
// (possibly after whitespace). This avoids incorrectly colouring inline arrays like
|
||||||
// "ports = [8000, 8001]" as table sections.
|
// "ports = [8000, 8001]" as table sections.
|
||||||
if ch == '[' {
|
if ch == '[' {
|
||||||
isSectionHeader := true
|
isSectionHeader := true
|
||||||
|
|||||||
@ -369,7 +369,7 @@ var tomlScenarios = []formatScenario{
|
|||||||
skipDoc: true,
|
skipDoc: true,
|
||||||
description: "blank",
|
description: "blank",
|
||||||
input: `A = "hello`,
|
input: `A = "hello`,
|
||||||
expectedError: `bad file 'sample.yml': basic string not terminated by "`,
|
expectedError: `bad file 'sample.yml': unterminated basic string`,
|
||||||
scenarioType: "decode-error",
|
scenarioType: "decode-error",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user