summaryrefslogtreecommitdiff
path: root/internal/repl/help_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/repl/help_test.go')
-rw-r--r--internal/repl/help_test.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/internal/repl/help_test.go b/internal/repl/help_test.go
index 9813ebb..b537c61 100644
--- a/internal/repl/help_test.go
+++ b/internal/repl/help_test.go
@@ -222,8 +222,26 @@ func TestHelpCompleterIntegration(t *testing.T) {
t.Fatal("NewAutoCompleter returned nil")
}
+ // "help " (with trailing space) should offer help topics, not "help help"
+ matches, _ := adapter.Do([]rune("help "), 5)
+ for _, m := range matches {
+ if string(m) == "help" {
+ t.Error("'help ' should not complete to 'help help'")
+ }
+ }
+ // Should include a known topic
+ foundPlus := false
+ for _, m := range matches {
+ if string(m) == "+" {
+ foundPlus = true
+ }
+ }
+ if !foundPlus {
+ t.Errorf("'help ' should suggest '+', got: %v", matches)
+ }
+
// Test help topic completion
- matches, _ := adapter.Do([]rune("help +"), 6)
+ matches, _ = adapter.Do([]rune("help +"), 6)
if len(matches) != 1 {
t.Errorf("'help +' should match +, got %d matches: %v", len(matches), matches)
}