void HtmlParser::prepend() { QFETCH(QString, base); QFETCH(QString, add); QFETCH(QString, expect); THtmlParser basep; basep.parse(base); THtmlParser addp; addp.parse(add); basep.prepend(1, addp); QString actual = basep.toString(); QCOMPARE(actual, expect); }
void TestTfpconverter::parse() { QFETCH(QString, fileName); QFile file(fileName); QVERIFY(file.open(QIODevice::ReadOnly | QIODevice::Text)); QTextStream ts(&file); ts.setCodec("UTF-8"); QString html = ts.readAll(); THtmlParser parser; parser.parse(html); QString result = parser.toString(); QFile res("result.phtm"); res.open(QIODevice::WriteOnly | QIODevice::Truncate); QTextStream rests(&res); rests.setCodec("UTF-8"); rests << result; res.close(); QCOMPARE(html, result); }