X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/6e3e9c5c10f3d35bae7e9846334974a09418aef7..087d725b5ab41ad34ffd24938482d45a8b99a080:/tools_test.go diff --git a/tools_test.go b/tools_test.go index dc08fdc..45cd4a2 100644 --- a/tools_test.go +++ b/tools_test.go @@ -113,7 +113,7 @@ func TestFileTools(t *testing.T) { } func TestZoomAndDateReadTheChat(t *testing.T) { - memory, err := openMemory(t.Context(), t.TempDir(), newTestClock().Now, newFakeSummarizer()) + memory, err := openMemory(t.Context(), t.TempDir(), newTestClock().Now, newFakeSummarizer(), discardLog()) require.NoError(t, err) defer func() { @@ -211,7 +211,7 @@ func TestHeadTailKeepsTheEndsOfALongOutput(t *testing.T) { require.True(t, strings.HasPrefix(text, "0000xxx")) require.True(t, strings.HasSuffix(text, "0999"+strings.Repeat("x", 995)+"\n")) require.Contains(t, text, fmt.Sprintf("\n[... %d bytes cut ...]\n", 1000*1000-toolClipCharacters)) - require.Equal(t, toolClipCharacters+len(fmt.Sprintf("\n[... %d bytes cut ...]\n", 1000*1000-toolClipCharacters)), len(text)) + require.Len(t, text, toolClipCharacters+len(fmt.Sprintf("\n[... %d bytes cut ...]\n", 1000*1000-toolClipCharacters))) } // ToolRecordingLog is a chat log that records each append and flush. The flush @@ -258,7 +258,7 @@ func (r *ToolRecordingLog) Events() []string { func newTestToolbox(t *testing.T, log ToolLog, dir string) *Toolbox { t.Helper() - memory, err := openMemory(t.Context(), t.TempDir(), newTestClock().Now, newFakeSummarizer()) + memory, err := openMemory(t.Context(), t.TempDir(), newTestClock().Now, newFakeSummarizer(), discardLog()) require.NoError(t, err) t.Cleanup(func() {