Changeset View
Changeset View
Standalone View
Standalone View
autotests/xmlextractortest.cpp
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Line(s) | 99 | { | |||
---|---|---|---|---|---|
108 | QCOMPARE(result.types().at(0), Type::Image); | 108 | QCOMPARE(result.types().at(0), Type::Image); | ||
109 | 109 | | |||
110 | QCOMPARE(result.properties().size(), 1); | 110 | QCOMPARE(result.properties().size(), 1); | ||
111 | QCOMPARE(result.properties().value(Property::Title).toString(), QStringLiteral("Document Title")); | 111 | QCOMPARE(result.properties().value(Property::Title).toString(), QStringLiteral("Document Title")); | ||
112 | 112 | | |||
113 | QVERIFY(result.text().isEmpty()); | 113 | QVERIFY(result.text().isEmpty()); | ||
114 | } | 114 | } | ||
115 | 115 | | |||
116 | void XmlExtractorTests::testXmlExtractorContainer() | ||||
117 | { | ||||
118 | XmlExtractor plugin{this}; | ||||
119 | | ||||
120 | SimpleExtractionResult result(testFilePath(QStringLiteral("test_with_container.svg")), | ||||
121 | QStringLiteral("image/svg"), | ||||
122 | ExtractionResult::ExtractEverything); | ||||
123 | plugin.extract(&result); | ||||
124 | | ||||
125 | QString content = QStringLiteral("Some text below <a>\n"); | ||||
126 | | ||||
127 | QCOMPARE(result.types().size(), 1); | ||||
128 | QCOMPARE(result.types().at(0), Type::Image); | ||||
129 | | ||||
130 | QCOMPARE(result.properties().size(), 0); | ||||
131 | | ||||
132 | content.replace(QLatin1Char('\n'), QLatin1Char(' ')); | ||||
133 | QCOMPARE(result.text(), content); | ||||
134 | } | ||||
135 | | ||||
116 | QTEST_GUILESS_MAIN(XmlExtractorTests) | 136 | QTEST_GUILESS_MAIN(XmlExtractorTests) | ||
117 | 137 | |