]> git.giacomolli.uk - onechat/blobdiff - tools_test.go
Check Go names and declarations with revive
[onechat] / tools_test.go
index dc08fdc7083bef07f4a0033f56be74458adaf6f6..45cd4a242f1ee6024406c6d56a4c918d8fc14998 100644 (file)
@@ -113,7 +113,7 @@ func TestFileTools(t *testing.T) {
 }
 
 func TestZoomAndDateReadTheChat(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() {
        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.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
 }
 
 // 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()
 
 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() {
        require.NoError(t, err)
 
        t.Cleanup(func() {