Commit be5c588f authored by Robby Stephenson's avatar Robby Stephenson
Browse files

Add unit test to support bug 449244

The paragraph widget supports emoji without problem. The XML export
seems to need to deal with it in a more robust manner.

CCBUG: 449244
parent 53923426
......@@ -254,6 +254,10 @@ void FieldWidgetTest::testPara() {
w.clear();
QVERIFY(w.text().isEmpty());
QString textWithEmoji = QString::fromUtf8("Title 🏡️");
w.setText(textWithEmoji);
QCOMPARE(w.text(), textWithEmoji);
}
void FieldWidgetTest::testNumber() {
......
......@@ -586,3 +586,22 @@ void TellicoReadTest::testBug443845() {
Tellico::Data::EntryPtr entry = coll->entries().at(0);
QVERIFY(entry);
}
void TellicoReadTest::testEmoji() {
QString textWithEmoji = QString::fromUtf8("Title 🏡️");
Tellico::Data::CollPtr coll(new Tellico::Data::Collection(true)); // add default fields
QVERIFY(coll->hasField(QStringLiteral("title")));
Tellico::Data::EntryPtr entry1(new Tellico::Data::Entry(coll));
entry1->setField(QStringLiteral("title"), textWithEmoji);
coll->addEntries(entry1);
Tellico::Export::TellicoXMLExporter exporter(coll);
exporter.setEntries(coll->entries());
Tellico::Import::TellicoImporter importer(exporter.text());
Tellico::Data::CollPtr coll2 = importer.collection();
QVERIFY(coll2);
Tellico::Data::EntryPtr entry2 = coll2->entries().at(0);
QVERIFY(entry2);
QCOMPARE(entry2->title(), textWithEmoji);
}
......@@ -59,6 +59,7 @@ private Q_SLOTS:
void testRelativeLink();
void testEmptyFirstTableRow();
void testBug443845();
void testEmoji();
private:
QList<Tellico::Data::CollPtr> m_collections;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment