From e6ad01fb90df7e324068f61ae96e056f327959c7 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Wed, 1 Oct 2025 00:00:54 +0900 Subject: Revise color configuration --- src/options_test.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/options_test.go') diff --git a/src/options_test.go b/src/options_test.go index 7b152d75..1494d960 100644 --- a/src/options_test.go +++ b/src/options_test.go @@ -300,8 +300,12 @@ func TestBind(t *testing.T) { } func TestColorSpec(t *testing.T) { + var base *tui.ColorTheme theme := tui.Dark256 - dark, _ := parseTheme(theme, "dark") + base, dark, _ := parseTheme(theme, "dark") + if *dark != *base { + t.Errorf("incorrect base theme returned") + } if *dark != *theme { t.Errorf("colors should be equivalent") } @@ -309,7 +313,10 @@ func TestColorSpec(t *testing.T) { t.Errorf("point should not be equivalent") } - light, _ := parseTheme(theme, "dark,light") + base, light, _ := parseTheme(theme, "dark,light") + if *light != *base { + t.Errorf("incorrect base theme returned") + } if *light == *theme { t.Errorf("should not be equivalent") } @@ -320,7 +327,7 @@ func TestColorSpec(t *testing.T) { t.Errorf("point should not be equivalent") } - customized, _ := parseTheme(theme, "fg:231,bg:232") + _, customized, _ := parseTheme(theme, "fg:231,bg:232") if customized.Fg.Color != 231 || customized.Bg.Color != 232 { t.Errorf("color not customized") } @@ -333,7 +340,7 @@ func TestColorSpec(t *testing.T) { t.Errorf("colors should now be equivalent: %v, %v", tui.Dark256, customized) } - customized, _ = parseTheme(theme, "fg:231,dark bg:232") + _, customized, _ = parseTheme(theme, "fg:231,dark bg:232") if customized.Fg != tui.Dark256.Fg || customized.Bg == tui.Dark256.Bg { t.Errorf("color not customized") } -- cgit v1.2.3