From ed2ad179547291dcc875f6347e80ff2912403d9e Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Sat, 4 Jul 2026 18:43:20 -0400 Subject: [PATCH] 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. --- pkg/yqlib/encoder_toml.go | 2 +- pkg/yqlib/toml_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/yqlib/encoder_toml.go b/pkg/yqlib/encoder_toml.go index e5d87ae9..e34fca59 100644 --- a/pkg/yqlib/encoder_toml.go +++ b/pkg/yqlib/encoder_toml.go @@ -677,7 +677,7 @@ func (te *tomlEncoder) colorizeToml(input []byte) []byte { // Table sections - [section] or [[array]] // 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. if ch == '[' { isSectionHeader := true diff --git a/pkg/yqlib/toml_test.go b/pkg/yqlib/toml_test.go index d36c10cd..634dd15c 100644 --- a/pkg/yqlib/toml_test.go +++ b/pkg/yqlib/toml_test.go @@ -369,7 +369,7 @@ var tomlScenarios = []formatScenario{ skipDoc: true, description: "blank", input: `A = "hello`, - expectedError: `bad file 'sample.yml': basic string not terminated by "`, + expectedError: `bad file 'sample.yml': unterminated basic string`, scenarioType: "decode-error", }, {