diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-11 08:38:08 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-05-11 08:38:08 (GMT) |
commit | f63e09c7cfa8ceb4bd66558d5025fe6ae41dcf82 (patch) | |
tree | b9201a5e73d4e663e1670875eca219ff8e7bf681 /tests/auto/qtextdocument/tst_qtextdocument.cpp | |
parent | 771e18e96d86f09bb047e5cf45cc33568e259a5d (diff) | |
parent | b7f84c44ae723a77ed34246949e49438491f54e9 (diff) | |
download | Qt-f63e09c7cfa8ceb4bd66558d5025fe6ae41dcf82.zip Qt-f63e09c7cfa8ceb4bd66558d5025fe6ae41dcf82.tar.gz Qt-f63e09c7cfa8ceb4bd66558d5025fe6ae41dcf82.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'tests/auto/qtextdocument/tst_qtextdocument.cpp')
-rw-r--r-- | tests/auto/qtextdocument/tst_qtextdocument.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qtextdocument/tst_qtextdocument.cpp b/tests/auto/qtextdocument/tst_qtextdocument.cpp index 4ef5299..63a172b 100644 --- a/tests/auto/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/qtextdocument/tst_qtextdocument.cpp @@ -161,6 +161,8 @@ private slots: void testUndoCommandAdded(); + void testUndoBlocks(); + private: void backgroundImage_checkExpectedHtml(const QTextDocument &doc); @@ -2435,5 +2437,21 @@ void tst_QTextDocument::testUndoCommandAdded() QCOMPARE(spy.count(), 1); } +void tst_QTextDocument::testUndoBlocks() +{ + QVERIFY(doc); + cursor.insertText("Hello World"); + cursor.insertText("period"); + doc->undo(); + QCOMPARE(doc->toPlainText(), QString("")); + cursor.insertText("Hello World"); + cursor.insertText("One\nTwo\nThree"); + QCOMPARE(doc->toPlainText(), QString("Hello WorldOne\nTwo\nThree")); + doc->undo(); + QCOMPARE(doc->toPlainText(), QString("Hello World")); + doc->undo(); + QCOMPARE(doc->toPlainText(), QString("")); +} + QTEST_MAIN(tst_QTextDocument) #include "tst_qtextdocument.moc" |