test(telegram): ensure newline split case exceeds max length
This commit is contained in:
parent
2d6ec2fb71
commit
dedb465377
1 changed files with 2 additions and 1 deletions
|
|
@ -919,7 +919,8 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn telegram_split_at_newline() {
|
fn telegram_split_at_newline() {
|
||||||
let text_block = "Line of text\n".repeat(TELEGRAM_MAX_MESSAGE_LENGTH / 13);
|
let line = "Line of text\n";
|
||||||
|
let text_block = line.repeat(TELEGRAM_MAX_MESSAGE_LENGTH / line.len() + 1);
|
||||||
let chunks = split_message_for_telegram(&text_block);
|
let chunks = split_message_for_telegram(&text_block);
|
||||||
assert!(chunks.len() >= 2);
|
assert!(chunks.len() >= 2);
|
||||||
for chunk in chunks {
|
for chunk in chunks {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue