diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/message_entities.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/test/message_entities.cpp b/test/message_entities.cpp index 4bf8f03b9..37863cb5f 100644 --- a/test/message_entities.cpp +++ b/test/message_entities.cpp @@ -1469,13 +1469,19 @@ TEST(MessageEntities, parse_markdown) { check_parse_markdown("🏟 🏟>", "Character '>' is reserved and must be escaped with the preceding '\\'"); check_parse_markdown("🏟 🏟![", "Can't find end of CustomEmoji entity at byte offset 9"); check_parse_markdown("🏟 🏟![👍", "Can't find end of CustomEmoji entity at byte offset 9"); - check_parse_markdown("🏟 🏟![👍]", "Custom emoji entity must contain a tg://emoji URL"); - check_parse_markdown("🏟 🏟; - check_parse_markdown("🏟 🏟", "URL must have scheme tg"); - check_parse_markdown("🏟 🏟", "URL must have host \"emoji\""); - check_parse_markdown("🏟 🏟", "URL must have parameters"); - check_parse_markdown("🏟 🏟", "Custom emoji URL must have an emoji identifier"); - check_parse_markdown("🏟 🏟", "Invalid custom emoji identifier specified"); + check_parse_markdown("🏟 🏟![👍]", "The entity must contain a tg://emoji or tg://time URL"); + check_parse_markdown("🏟 🏟; + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟; + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); + check_parse_markdown("🏟 🏟", "Invalid tg://emoji or tg://time URL specified"); check_parse_markdown(">*b\n>ld \n>bo\nld*\nasd\ndef", "Can't find end of Bold entity at byte offset 1"); check_parse_markdown(">\n*a*>2", "Character '>' is reserved and must be escaped with the preceding '\\'"); check_parse_markdown(">asd\n>q||e||w||\n||asdad", "Can't find end of Spoiler entity at byte offset 16"); @@ -1546,6 +1552,18 @@ TEST(MessageEntities, parse_markdown) { {{0, 12, td::UserId(static_cast<td::int64>(123456))}}); check_parse_markdown("🏟 🏟a", "🏟 🏟👍a", {{td::MessageEntity::Type::CustomEmoji, 5, 2, td::CustomEmojiId(static_cast<td::int64>(25))}}); + check_parse_markdown("🏟 🏟a", "🏟 🏟👍a", + {{td::MessageEntity::Type::FormattedDate, 5, 2, 25, 0}}); + check_parse_markdown("🏟 🏟a", "🏟 🏟👍a", + {{td::MessageEntity::Type::FormattedDate, 5, 2, 25, 1}}); + check_parse_markdown("🏟 🏟a", "🏟 🏟👍a", + {{td::MessageEntity::Type::FormattedDate, 5, 2, 25, 10}}); + check_parse_markdown("🏟 🏟a", "🏟 🏟👍a", + {{td::MessageEntity::Type::FormattedDate, 5, 2, 25, 20}}); + check_parse_markdown("🏟 🏟a", "🏟 🏟👍a", + {{td::MessageEntity::Type::FormattedDate, 5, 2, 25, 32}}); + check_parse_markdown("🏟 🏟a", "🏟 🏟👍a", + {{td::MessageEntity::Type::FormattedDate, 5, 2, 25, 34}}); check_parse_markdown("> \n> \n>", " \n \n", {{td::MessageEntity::Type::BlockQuote, 0, 4}}); check_parse_markdown("> \\>\n \\> \n>", " >\n > \n", {{td::MessageEntity::Type::BlockQuote, 0, 3}}); check_parse_markdown("abc\n> \n> \n>\ndef", "abc\n \n \n\ndef", {{td::MessageEntity::Type::BlockQuote, 4, 5}}); |
