feat(summary): send complete articles within user budget (#39)
This commit is contained in:
@ -54,7 +54,7 @@ func TestTicket36EnrichmentValidationAndUTF8Limit(t *testing.T) {
|
||||
default:
|
||||
content := ""
|
||||
if scenario == "oversize" {
|
||||
content = strings.Repeat("🙂é", maxContentBytes)
|
||||
content = strings.Repeat("🙂é", 32*1024)
|
||||
}
|
||||
body, _ := json.Marshal(map[string]any{"articles": []any{map[string]any{"url": url, "content": content, "published_at": nil}}})
|
||||
raw = string(body)
|
||||
@ -66,10 +66,10 @@ func TestTicket36EnrichmentValidationAndUTF8Limit(t *testing.T) {
|
||||
if err != nil || len(got) != 1 || !got[0].PublishedAt.Equal(existing) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(got[0].Content) > maxContentBytes || !utf8.ValidString(got[0].Content) {
|
||||
if !utf8.ValidString(got[0].Content) || scenario == "oversize" && got[0].Content != strings.Repeat("🙂é", 32*1024) {
|
||||
t.Fatal("invalid content boundary")
|
||||
}
|
||||
if got[0].ContentTruncated != (scenario == "oversize") {
|
||||
if got[0].ContentTruncated {
|
||||
t.Fatal("missing limit flag")
|
||||
}
|
||||
} else if err == nil || got != nil || strings.Contains(err.Error(), "PRIVATE") || strings.Contains(err.Error(), "http") {
|
||||
|
||||
Reference in New Issue
Block a user