TestPromptHistorySkipEmpty: empty submits never reach the file, so a stray ↵ can't pollute recall with blanks.
(t *testing.T)
| 56 | // TestPromptHistorySkipEmpty: empty submits never reach the file, so a stray ↵ |
| 57 | // can't pollute recall with blanks. |
| 58 | func TestPromptHistorySkipEmpty(t *testing.T) { |
| 59 | dir := t.TempDir() |
| 60 | if err := appendPromptHistory(dir, ""); err != nil { |
| 61 | t.Fatal(err) |
| 62 | } |
| 63 | if got := loadPromptHistory(dir); len(got) != 0 { |
| 64 | t.Errorf("empty prompt should not be saved, got %d", len(got)) |
| 65 | } |
| 66 | if _, err := os.Stat(filepath.Join(dir, historyFileName)); !os.IsNotExist(err) { |
| 67 | t.Errorf("history file should not exist after only-empty append, err=%v", err) |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | // TestPromptHistoryClear: clearPromptHistory removes the file; a missing file |
| 72 | // is not an error. Mirrors /clear semantics. |
nothing calls this directly
no test coverage detected