From a2a300a0065e3f212a59db1bb77b493ee2854aef Mon Sep 17 00:00:00 2001 From: Roland Rodriguez Date: Fri, 6 Dec 2024 13:00:00 -0600 Subject: [PATCH] fix(fmt): format test file --- help/help_whitespace_test.go | 86 ++++++++++++++++++------------------ 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/help/help_whitespace_test.go b/help/help_whitespace_test.go index 8f8b8c25..b3c4efc4 100644 --- a/help/help_whitespace_test.go +++ b/help/help_whitespace_test.go @@ -55,48 +55,48 @@ func TestWhitespaceStyle(t *testing.T) { }) } -// Test with a disabled item and custom style -for _, tc := range []struct { - name string - setupFn func() - bindings [][]key.Binding -}{ - { - name: "disabled_item", - setupFn: func() { - m.Width = 40 - }, - bindings: [][]key.Binding{{ - key.NewBinding(k, key.WithHelp("enter", "continue")), - key.NewBinding(k, key.WithHelp("ctrl+c", "quit"), key.WithDisabled()), - }}, - }, - { - name: "custom_style", - setupFn: func() { - m.Width = 40 - customBg := lipgloss.Color("#00FF00") - m.Styles.FullWhitespace = m.Styles.FullWhitespace.Background(customBg) - m.Styles.ShortWhitespace = m.Styles.ShortWhitespace.Background(customBg) - }, - bindings: kb, - }, -} { - t.Run(tc.name+"_full", func(t *testing.T) { - tc.setupFn() - s := m.FullHelpView(tc.bindings) - golden.RequireEqual(t, []byte(s)) - }) + // Test with a disabled item and custom style + for _, tc := range []struct { + name string + setupFn func() + bindings [][]key.Binding + }{ + { + name: "disabled_item", + setupFn: func() { + m.Width = 40 + }, + bindings: [][]key.Binding{{ + key.NewBinding(k, key.WithHelp("enter", "continue")), + key.NewBinding(k, key.WithHelp("ctrl+c", "quit"), key.WithDisabled()), + }}, + }, + { + name: "custom_style", + setupFn: func() { + m.Width = 40 + customBg := lipgloss.Color("#00FF00") + m.Styles.FullWhitespace = m.Styles.FullWhitespace.Background(customBg) + m.Styles.ShortWhitespace = m.Styles.ShortWhitespace.Background(customBg) + }, + bindings: kb, + }, + } { + t.Run(tc.name+"_full", func(t *testing.T) { + tc.setupFn() + s := m.FullHelpView(tc.bindings) + golden.RequireEqual(t, []byte(s)) + }) - t.Run(tc.name+"_short", func(t *testing.T) { - tc.setupFn() - // Flatten the bindings for short help - var shortBindings []key.Binding - for _, group := range tc.bindings { - shortBindings = append(shortBindings, group...) - } - s := m.ShortHelpView(shortBindings) - golden.RequireEqual(t, []byte(s)) - }) -} + t.Run(tc.name+"_short", func(t *testing.T) { + tc.setupFn() + // Flatten the bindings for short help + var shortBindings []key.Binding + for _, group := range tc.bindings { + shortBindings = append(shortBindings, group...) + } + s := m.ShortHelpView(shortBindings) + golden.RequireEqual(t, []byte(s)) + }) + } }