]> git.giacomolli.uk - onechat/blobdiff - whatsapp_import_test.go
Separate multiline Go statements
[onechat] / whatsapp_import_test.go
index 1f9c9afc23de996095d84a93856be679b9ac17f9..553a2cbc288cc365a99a98a72fbb0149fd91b962 100644 (file)
@@ -486,6 +486,7 @@ func TestWhatsAppImportChildPlanReadsRootCutoffButNotRootImportedDays(t *testing
                        Date: "2025-01-03T10:20:00Z",
                },
        })
                        Date: "2025-01-03T10:20:00Z",
                },
        })
+
        rebuildTestLog(t, childDir, []DatedMessage{
                {
                        Kind: "work",
        rebuildTestLog(t, childDir, []DatedMessage{
                {
                        Kind: "work",
@@ -529,6 +530,7 @@ func TestWhatsAppImportChildRebuildUsesOwnPromptAndCache(t *testing.T) {
                Text: "Keep the root history.",
                Date: "2025-02-01T00:00:00Z",
        }})
                Text: "Keep the root history.",
                Date: "2025-02-01T00:00:00Z",
        }})
+
        rebuildTestLog(t, childDir, []DatedMessage{{
                Kind: "user",
                Text: "Keep the child history.",
        rebuildTestLog(t, childDir, []DatedMessage{{
                Kind: "user",
                Text: "Keep the child history.",
@@ -563,7 +565,7 @@ func TestWhatsAppImportChildRebuildUsesOwnPromptAndCache(t *testing.T) {
        }
 
        client := newModelClient(server.URL, ModelAPIKey(modelTestKey), child.CacheKey(), filepath.Join(t.TempDir(), "usage.jsonl"))
        }
 
        client := newModelClient(server.URL, ModelAPIKey(modelTestKey), child.CacheKey(), filepath.Join(t.TempDir(), "usage.jsonl"))
-       backup, err := rebuild(t.Context(), child, plan.added, client, newCompactor(client, child.Prompt, defaultConfig().Compactor, child.Tools()), &strings.Builder{})
+       backup, err := rebuild(t.Context(), child, plan.added, client, newCompactor(client, child.Prompt, defaultConfig().Compactor, child.Tools(), child.Images()), &strings.Builder{})
        require.NoError(t, err)
        require.Equal(t, before, rebuildTestSnapshot(t, backup))
        require.Equal(t, root.dir, filepath.Dir(backup))
        require.NoError(t, err)
        require.Equal(t, before, rebuildTestSnapshot(t, backup))
        require.Equal(t, root.dir, filepath.Dir(backup))
@@ -613,7 +615,7 @@ func TestWhatsAppImportChildFailureKeepsConfiguredChildren(t *testing.T) {
                Kind: "work",
                Text: strings.Repeat("The plan is ready. ", 80),
                Date: "2025-01-01T08:00:00Z",
                Kind: "work",
                Text: strings.Repeat("The plan is ready. ", 80),
                Date: "2025-01-01T08:00:00Z",
-       }}, client, newCompactor(client, child.Prompt, defaultConfig().Compactor, child.Tools()), &strings.Builder{})
+       }}, client, newCompactor(client, child.Prompt, defaultConfig().Compactor, child.Tools(), child.Images()), &strings.Builder{})
        require.ErrorContains(t, err, "rebuild")
        require.Equal(t, before, rebuildTestSnapshot(t, root.dir))
 
        require.ErrorContains(t, err, "rebuild")
        require.Equal(t, before, rebuildTestSnapshot(t, root.dir))