From dac90ba0e3036a15779da70e771c5cf2818c817f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 15 Sep 2025 08:07:51 +0300 Subject: release: v0.10.1 - Fix TUI 'p' hotkey: open editor for Custom prompt - Introduce ActionCustomPrompt to disambiguate from Custom actions submenu - Bump version to 0.10.1 --- internal/appconfig/custom_validation_more_test.go | 39 +++++++++++------------ 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'internal/appconfig') diff --git a/internal/appconfig/custom_validation_more_test.go b/internal/appconfig/custom_validation_more_test.go index 05d0d1a..36212aa 100644 --- a/internal/appconfig/custom_validation_more_test.go +++ b/internal/appconfig/custom_validation_more_test.go @@ -1,16 +1,16 @@ package appconfig import ( - "path/filepath" - "strings" - "testing" + "path/filepath" + "strings" + "testing" ) func TestCustomActions_MissingFields(t *testing.T) { - dir := t.TempDir() - t.Setenv("XDG_CONFIG_HOME", dir) - cfgPath := filepath.Join(dir, "hexai", "config.toml") - writeFile(t, cfgPath, ` + dir := t.TempDir() + t.Setenv("XDG_CONFIG_HOME", dir) + cfgPath := filepath.Join(dir, "hexai", "config.toml") + writeFile(t, cfgPath, ` [prompts.code_action] [[prompts.code_action.custom]] title = "No ID" @@ -19,17 +19,17 @@ instruction = "x" id = "no-title" instruction = "x" `) - cfg := Load(newLogger()) - if err := cfg.Validate(); err == nil || (!strings.Contains(err.Error(), "missing required field id") && !strings.Contains(err.Error(), "missing required field title")) { - t.Fatalf("expected missing field error, got %v", err) - } + cfg := Load(newLogger()) + if err := cfg.Validate(); err == nil || (!strings.Contains(err.Error(), "missing required field id") && !strings.Contains(err.Error(), "missing required field title")) { + t.Fatalf("expected missing field error, got %v", err) + } } func TestCustomActions_InvalidHotkeys(t *testing.T) { - dir := t.TempDir() - t.Setenv("XDG_CONFIG_HOME", dir) - cfgPath := filepath.Join(dir, "hexai", "config.toml") - writeFile(t, cfgPath, ` + dir := t.TempDir() + t.Setenv("XDG_CONFIG_HOME", dir) + cfgPath := filepath.Join(dir, "hexai", "config.toml") + writeFile(t, cfgPath, ` [prompts.code_action] [[prompts.code_action.custom]] id = "a" @@ -40,9 +40,8 @@ hotkey = "too" [tmux] custom_menu_hotkey = "ab" `) - cfg := Load(newLogger()) - if err := cfg.Validate(); err == nil || (!strings.Contains(err.Error(), "hotkey must be a single character") && !strings.Contains(err.Error(), "invalid tmux.custom_menu_hotkey")) { - t.Fatalf("expected invalid hotkey error, got %v", err) - } + cfg := Load(newLogger()) + if err := cfg.Validate(); err == nil || (!strings.Contains(err.Error(), "hotkey must be a single character") && !strings.Contains(err.Error(), "invalid tmux.custom_menu_hotkey")) { + t.Fatalf("expected invalid hotkey error, got %v", err) + } } - -- cgit v1.2.3