fix: tighten HTML-expansion test to stay under chunk size
Reduce markdown input from 700 to 600 repeats (3600 runes) so it stays under the 4000-rune chunk threshold. This ensures the test actually exercises the HTML-expansion re-splitting logic rather than being split at the markdown level first. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
df53f4411a
commit
0e810a2ec4
1 changed files with 4 additions and 4 deletions
|
|
@ -207,11 +207,11 @@ func TestSend_MarkdownShortButHTMLLong_MultipleCalls(t *testing.T) {
|
||||||
}
|
}
|
||||||
ch := newTestChannel(t, caller)
|
ch := newTestChannel(t, caller)
|
||||||
|
|
||||||
// Create markdown whose length is <= 4096 but whose HTML expansion is much longer.
|
// Create markdown whose length is <= 4000 but whose HTML expansion is much longer.
|
||||||
// "**a**" (5 chars) becomes "<b>a</b>" (8 chars) in HTML, so repeating it many times
|
// "**a** " (6 chars) becomes "<b>a</b> " (9 chars) in HTML, so repeating it many times
|
||||||
// yields HTML that exceeds Telegram's limit while markdown stays within it.
|
// yields HTML that exceeds Telegram's limit while markdown stays within it.
|
||||||
markdownContent := strings.Repeat("**a** ", 700) // ~4200 chars markdown, but HTML ~5600+ chars
|
markdownContent := strings.Repeat("**a** ", 600) // 3600 chars markdown, HTML ~5400+ chars
|
||||||
assert.LessOrEqual(t, len([]rune(markdownContent)), 4200, "markdown content should be near Telegram limit")
|
assert.LessOrEqual(t, len([]rune(markdownContent)), 4000, "markdown content must not exceed chunk size")
|
||||||
|
|
||||||
htmlExpanded := markdownToTelegramHTML(markdownContent)
|
htmlExpanded := markdownToTelegramHTML(markdownContent)
|
||||||
assert.Greater(
|
assert.Greater(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue