(t *testing.T)
| 53 | } |
| 54 | |
| 55 | func TestGetProviderSuggestions(t *testing.T) { |
| 56 | cli := newProviderTestCLI("OPENAI", []string{"OPENAI", "CLAUDEAI", "XAI"}) |
| 57 | |
| 58 | if got := cli.getProviderSuggestions(paletteDoc("/provider ")); len(got) != 3 { |
| 59 | t.Fatalf("bare /provider suggestions = %d, want 3", len(got)) |
| 60 | } |
| 61 | got := cli.getProviderSuggestions(paletteDoc("/provider CL")) |
| 62 | if len(got) != 1 || got[0].Text != "CLAUDEAI" { |
| 63 | t.Errorf("prefix CL = %v, want [CLAUDEAI]", got) |
| 64 | } |
| 65 | // Once a provider is chosen there is nothing more to complete. |
| 66 | if got := cli.getProviderSuggestions(paletteDoc("/provider OPENAI ")); len(got) != 0 { |
| 67 | t.Errorf("after a provider is chosen, want 0 suggestions, got %d", len(got)) |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | func TestHandleProviderCommand(t *testing.T) { |
| 72 | t.Setenv("HOME", t.TempDir()) // isolate the runtime-model state file write |
nothing calls this directly
no test coverage detected