else if(dictionaryReader.tokenType() == QXmlStreamReader::Characters) {
if(match) {
QString temp(dictionaryReader.text().toString());
+ if(temp=="\n")
+ temp=dictionaryReader.readElementText();
temp.replace("\n","");
if(temp == ""){
+ int i=0;
while(dictionaryReader.name()!="ar"&&
!dictionaryReader.atEnd()){
dictionaryReader.readNext();
+ if(dictionaryReader.name()!="" && dictionaryReader.name()!="ar") {
+ if(i%2)
+ temp+=tr("</");
+ else
+ temp+=tr("<");
+ temp=temp+dictionaryReader.name().toString() + tr(">");
+ i++;
+ }
temp+=dictionaryReader.text().toString();
}
}
xdxfPlugin->search("wino");
QCOMPARE(xdxfPlugin->search("."), QString("kropka\n"));
QCOMPARE(xdxfPlugin->search("1"), QString("one\n"));
+
+ QCOMPARE(xdxfPlugin->search("test"), QString("test1\n"));
}
void XdxfTest::searchWordList() {
CommonDictInterface *xdxfPlugin = xdxfPluginB.getNew(settings);
QList<Translation*> te = xdxfPlugin->searchWordList(".", 10);
if(te.size()>0)
- QCOMPARE(te.size(), 8);
+ QCOMPARE(te.size(), 9);
QList<Translation*> te2 = xdxfPlugin->searchWordList("1",10);
QCOMPARE(te2.size(), 5);
QCOMPARE(te4.at(0)->key(), QString("house"));
QList<Translation*> te5 = xdxfPlugin->searchWordList("*");
- QCOMPARE(te5.size(), 8);
+ QCOMPARE(te5.size(), 9);
QList<Translation*> te6 = xdxfPlugin->searchWordList("*", 8);
QCOMPARE(te6.size(), 8);
QFuture<QList<Translation*> > future = QtConcurrent::run(xdxfPlugin, &CommonDictInterface::searchWordList, string, 10);
QList<Translation*> te5 = future.result();
- QCOMPARE(te5.size(), 8);
+ QCOMPARE(te5.size(), 9);
}