From e4bff687cf1e13e5a2f68f45103ab2ae3b18e203 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 12 May 2022 19:18:14 +0300 Subject: [PATCH] Add td::remove_emoji_selectors test. --- tdutils/test/emoji.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tdutils/test/emoji.cpp b/tdutils/test/emoji.cpp index c5c41b23e..fa0a4e12c 100644 --- a/tdutils/test/emoji.cpp +++ b/tdutils/test/emoji.cpp @@ -92,3 +92,34 @@ TEST(Emoji, remove_emoji_modifiers) { test_remove_emoji_modifiers("🎄", "🎄"); test_remove_emoji_modifiers("🧑‍🎄", "🧑‍🎄"); } + +static void test_remove_emoji_selectors(td::string emoji, const td::string &result) { + ASSERT_STREQ(result, td::remove_emoji_selectors(result)); + ASSERT_STREQ(result, td::remove_emoji_selectors(emoji)); +} + +TEST(Emoji, remove_emoji_selectors) { + test_remove_emoji_selectors("", ""); + test_remove_emoji_selectors("👩🏼‍❤‍💋‍👩🏻", "👩🏼‍❤‍💋‍👩🏻"); + test_remove_emoji_selectors("👩🏼‍❤️‍💋‍👩🏻", "👩🏼‍❤‍💋‍👩🏻"); + test_remove_emoji_selectors("👋🏻", "👋🏻"); + test_remove_emoji_selectors("👋🏼", "👋🏼"); + test_remove_emoji_selectors("👋🏽", "👋🏽"); + test_remove_emoji_selectors("👋🏾", "👋🏾"); + test_remove_emoji_selectors("👋🏿", "👋🏿"); + test_remove_emoji_selectors("🏻", "🏻"); + test_remove_emoji_selectors("🏼", "🏼"); + test_remove_emoji_selectors("🏽", "🏽"); + test_remove_emoji_selectors("🏾", "🏾"); + test_remove_emoji_selectors("🏿", "🏿"); + test_remove_emoji_selectors("⌚", "⌚"); + test_remove_emoji_selectors("↔", "↔"); + test_remove_emoji_selectors("🪗", "🪗"); + test_remove_emoji_selectors("2️⃣", "2⃣"); + test_remove_emoji_selectors("2⃣", "2⃣"); + test_remove_emoji_selectors("❤️", "❤"); + test_remove_emoji_selectors("❤", "❤"); + test_remove_emoji_selectors("⌚", "⌚"); + test_remove_emoji_selectors("🎄", "🎄"); + test_remove_emoji_selectors("🧑‍🎄", "🧑‍🎄"); +}