mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
588ed557f0
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
22 lines
957 B
C++
22 lines
957 B
C++
#include "util/Helpers.hpp"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
using namespace chatterino;
|
|
|
|
TEST(Helpers, formatUserMention)
|
|
{
|
|
const auto userName = "pajlada";
|
|
|
|
// A user mention that is the first word, that has 'mention with comma' enabled should have a comma appended at the end.
|
|
EXPECT_EQ(formatUserMention(userName, true, true), "pajlada,");
|
|
|
|
// A user mention that is not the first word, but has 'mention with comma' enabled should not have a comma appended at the end.
|
|
EXPECT_EQ(formatUserMention(userName, false, true), "pajlada");
|
|
|
|
// A user mention that is the first word, but has 'mention with comma' disabled should not have a comma appended at the end.
|
|
EXPECT_EQ(formatUserMention(userName, true, false), "pajlada");
|
|
|
|
// A user mention that is neither the first word, nor has 'mention with comma' enabled should not have a comma appended at the end.
|
|
EXPECT_EQ(formatUserMention(userName, false, false), "pajlada");
|
|
}
|