Browse Source

refactor: removed TextFormatter instantiations from tests

reviewable/pr4593/r6
noavarice 8 years ago
parent
commit
a9eca8e626
No known key found for this signature in database
GPG Key ID: 52A50775BE13DF17
  1. 10
      test/chatlog/textformatter_test.cpp

10
test/chatlog/textformatter_test.cpp

@ -126,9 +126,8 @@ static void commonTest(bool showSymbols, const StringToString map, const QString @@ -126,9 +126,8 @@ static void commonTest(bool showSymbols, const StringToString map, const QString
{
for (QString key : map.keys()) {
QString source = key.arg(signs);
TextFormatter tf = TextFormatter(source);
QString result = map[key].arg(showSymbols ? signs : "", signsToTags[signs]);
QVERIFY(tf.applyStyling(showSymbols) == result);
QVERIFY(applyMarkdown(source, showSymbols) == result);
}
}
@ -139,8 +138,8 @@ static void commonTest(bool showSymbols, const StringToString map, const QString @@ -139,8 +138,8 @@ static void commonTest(bool showSymbols, const StringToString map, const QString
static void commonExceptionsTest(const QString signs)
{
for (QString source : commonExceptions) {
TextFormatter tf = TextFormatter(source.arg(signs));
QVERIFY(tf.applyStyling(false) == source.arg(signs));
QString message = source.arg(signs);
QVERIFY(applyMarkdown(message, false) == message);
}
}
@ -151,8 +150,7 @@ static void commonExceptionsTest(const QString signs) @@ -151,8 +150,7 @@ static void commonExceptionsTest(const QString signs)
static void specialTest(const StringToString map)
{
for (QString key : map.keys()) {
TextFormatter tf = TextFormatter(key);
QVERIFY(tf.applyStyling(false) == map[key]);
QVERIFY(applyMarkdown(key, false) == map[key]);
}
}

Loading…
Cancel
Save