Merge d015940519 into bc1cd64c78
This commit is contained in:
commit
6c8381e52f
2 changed files with 4 additions and 1 deletions
|
|
@ -729,7 +729,7 @@ func renderPrimeMemories(memories map[string]string, compact bool, maxCount, max
|
|||
}
|
||||
sb.WriteString("Stored via `bd remember`. Update in place with `bd remember --key <key> \"new content\"`. Search with `bd memories <keyword>`. Remove with `bd forget <key>`.\n\n")
|
||||
if elided > 0 {
|
||||
sb.WriteString(fmt.Sprintf("> %d more memories are not shown here (%s). Browse the full set with `bd memories <keyword>` or recall one with `bd remember <key>`.\n\n", elided, primeMemoryCapNote(noteCount, noteChars)))
|
||||
sb.WriteString(fmt.Sprintf("> %d more memories are not shown here (%s). Browse the full set with `bd memories <keyword>` or read one in full with `bd recall <key>`.\n\n", elided, primeMemoryCapNote(noteCount, noteChars)))
|
||||
}
|
||||
}
|
||||
for _, entry := range entries {
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ func TestRenderPrimeMemoriesCountCap(t *testing.T) {
|
|||
if strings.Contains(out, "### mem-02\n") {
|
||||
t.Fatalf("memory beyond the cap leaked into output: %q", out)
|
||||
}
|
||||
if !strings.Contains(out, "read one in full with `bd recall <key>`") || strings.Contains(out, "recall one with `bd remember") {
|
||||
t.Fatalf("elision banner must point at bd recall, not bd remember (which writes a new memory): %q", out)
|
||||
}
|
||||
if banner, entries := strings.Index(out, "not shown"), strings.Index(out, "### mem-00"); banner > entries {
|
||||
t.Fatalf("elision banner must precede entries so host truncation cannot hide it: %q", out)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue