feat(history): add Atuin context scopes
This commit is contained in:
@@ -30,6 +30,9 @@ func TestDefaultConfigAndState(t *testing.T) {
|
||||
if !cfg.Core.CobraProbeEnabled {
|
||||
t.Errorf("expected cobra probing to be enabled by default")
|
||||
}
|
||||
if cfg.History.Scope != "global" {
|
||||
t.Errorf("expected global history scope, got %q", cfg.History.Scope)
|
||||
}
|
||||
|
||||
// test manual provider registration
|
||||
cfg.AI.Provider = "custom"
|
||||
@@ -207,6 +210,21 @@ func TestValidateAutoUpdateRange(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateHistoryScope(t *testing.T) {
|
||||
cfg := DefaultConfig()
|
||||
for _, scope := range []string{"global", "directory", "workspace", "hybrid"} {
|
||||
cfg.History.Scope = scope
|
||||
if err := validate(cfg); err != nil {
|
||||
t.Errorf("expected history scope %q to be valid: %v", scope, err)
|
||||
}
|
||||
}
|
||||
|
||||
cfg.History.Scope = "session"
|
||||
if err := validate(cfg); err == nil {
|
||||
t.Error("expected unsupported history scope to be rejected")
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadSave(t *testing.T) {
|
||||
tmpDir, err := os.MkdirTemp("", "iris-config-test")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user