refactor(emojis): use std::variant and QStringView (#6714)

This commit is contained in:
Nerixyz
2026-01-05 21:06:42 +01:00
committed by GitHub
parent 327dc0ebcb
commit b7b592098f
8 changed files with 52 additions and 52 deletions
+6 -6
View File
@@ -65,7 +65,7 @@ TEST(Emojis, Parse)
struct TestCase {
QString input;
std::vector<boost::variant<EmotePtr, QString>> expectedOutput;
std::vector<std::variant<EmotePtr, QStringView>> expectedOutput;
};
auto getEmoji = [&](auto code) {
@@ -96,23 +96,23 @@ TEST(Emojis, Parse)
const std::vector<TestCase> tests{
{
"abc",
{"abc"},
{u"abc"},
},
{
"abc def",
{"abc def"},
{u"abc def"},
},
{
"abc🐧def",
{"abc", penguin, "def"},
{u"abc", penguin, u"def"},
},
{
"abc 🐧def",
{"abc ", penguin, "def"},
{u"abc ", penguin, u"def"},
},
{
" abc🐧 def ",
{" abc", penguin, " def "},
{u" abc", penguin, u" def "},
},
{
"🐧",