@@ -633,7 +633,7 @@ func TestTomlScenarios(t *testing.T) {
633633func TestTomlColourization (t * testing.T ) {
634634 // Test that inline arrays are not coloured as table sections
635635 encoder := & tomlEncoder {prefs : TomlPreferences {ColorsEnabled : true }}
636-
636+
637637 // Create TOML with both table sections and inline arrays
638638 input := []byte (`[database]
639639enabled = true
@@ -642,21 +642,21 @@ ports = [8000, 8001, 8002]
642642[servers]
643643alpha = "test"
644644` )
645-
645+
646646 result := encoder .colorizeToml (input )
647647 resultStr := string (result )
648-
648+
649649 // The bug would cause the inline array [8000, 8001, 8002] to be
650650 // coloured with the section colour (Yellow + Bold) instead of being
651651 // left uncoloured or coloured differently.
652- //
652+ //
653653 // To test this, we check that the section colour codes appear only
654654 // for actual table sections, not for inline arrays.
655-
655+
656656 // Get the ANSI codes for section colour (Yellow + Bold)
657657 sectionColour := color .New (color .FgYellow , color .Bold ).SprintFunc ()
658658 sampleSection := sectionColour ("[database]" )
659-
659+
660660 // Extract just the ANSI codes from the sample
661661 // ANSI codes start with \x1b[
662662 var ansiStart string
@@ -673,12 +673,12 @@ alpha = "test"
673673 }
674674 }
675675 }
676-
676+
677677 // Count how many times the section colour appears in the output
678678 // It should appear exactly twice: once for [database] and once for [servers]
679679 // If it appears more times (e.g., for [8000, 8001, 8002]), that's the bug
680680 sectionColourCount := strings .Count (resultStr , ansiStart )
681-
681+
682682 // We expect exactly 2 occurrences (for [database] and [servers])
683683 // The bug would cause more occurrences (e.g., also for [8000)
684684 if sectionColourCount != 2 {
0 commit comments