Test to be sure that translation of placeholders are correct.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-16 13:09:29 +03:00
parent 4d58e05f3e
commit af5c82bdf6
4 changed files with 32 additions and 0 deletions

View File

@ -122,6 +122,19 @@ const QString pl_pFileName = QStringLiteral("pFileName");
const QString pl_mFileName = QStringLiteral("mFileName");
const QString pl_mExt = QStringLiteral("mExt");
const QStringList labelTemplatePlaceholders = QStringList() << pl_size
<< pl_height
<< pl_date
<< pl_time
<< pl_patternName
<< pl_patternNumber
<< pl_author
<< pl_customer
<< pl_pExt
<< pl_pFileName
<< pl_mFileName
<< pl_mExt;
const QString cursorArrowOpenHand = QStringLiteral("://cursor/cursor-arrow-openhand.png");
const QString cursorArrowCloseHand = QStringLiteral("://cursor/cursor-arrow-closehand.png");

View File

@ -364,6 +364,8 @@ extern const QString pl_pFileName;
extern const QString pl_mFileName;
extern const QString pl_mExt;
extern const QStringList labelTemplatePlaceholders;
extern const QString cursorArrowOpenHand;
extern const QString cursorArrowCloseHand;

View File

@ -224,6 +224,22 @@ void TST_BuitInRegExp::TestCheckInternalVaribleRegExp()
}
}
//---------------------------------------------------------------------------------------------------------------------
void TST_BuitInRegExp::TestTemplatePlaceholders()
{
QSet<QString> originals;
QSet<QString> translations;
for (int i = 0; i < labelTemplatePlaceholders.size(); ++i)
{
originals.insert(labelTemplatePlaceholders.at(i));
translations.insert(m_trMs->PlaceholderToUser(labelTemplatePlaceholders.at(i)));
}
QCOMPARE(originals.size(), labelTemplatePlaceholders.size()); // All tags are unique
QCOMPARE(translations.size(), labelTemplatePlaceholders.size()); // All translated tags are unique
}
//---------------------------------------------------------------------------------------------------------------------
void TST_BuitInRegExp::cleanupTestCase()
{

View File

@ -61,6 +61,7 @@ private slots:
void TestCheckUnderlineExists();
void TestCheckInternalVaribleRegExp_data();
void TestCheckInternalVaribleRegExp();
void TestTemplatePlaceholders();
void cleanupTestCase();
private: