~ubuntu-branches/ubuntu/trusty/grantlee/trusty

« back to all changes in this revision

Viewing changes to textdocument/tests/htmlbuildertest.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2012-11-21 11:04:39 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20121121110439-tzyjomgtnpmdnsxn
Tags: 0.3.0-0ubuntu1
* New upsteam release
  - Update libgrantlee-core0.symbols
* Add wildcards to *.install files to avoid unneeded build failures

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <QtCore/QRegExp>
25
25
#include <QtGui/QTextCursor>
26
26
#include <QtGui/QTextDocument>
27
 
#include <QtGui/QTextEdit>
28
27
 
29
28
#include "coverageobject.h"
30
29
#include "markupdirector.h"
59
58
  void testEachFormatTagSingly();
60
59
  void testHorizontalRule();
61
60
  void testNewlines();
62
 
  void testNewlinesThroughQTextEdit();
 
61
  void testNewlinesThroughQTextCursor();
63
62
 
64
63
};
65
64
 
514
513
    QVERIFY(regex.exactMatch(result));
515
514
}
516
515
 
517
 
void TestHtmlOutput::testNewlinesThroughQTextEdit()
 
516
void TestHtmlOutput::testNewlinesThroughQTextCursor()
518
517
{
519
 
 
520
 
    QTextEdit *te = new QTextEdit();
521
 
    QTextCursor cursor = te->textCursor();
 
518
    QTextDocument *doc = new QTextDocument(this);
 
519
    QTextCursor cursor(doc);
522
520
    cursor.movePosition(QTextCursor::Start);
523
521
    cursor.insertText( QLatin1String( "Foo" ) );
524
522
    cursor.insertText( QLatin1String( "\n" ) );
528
526
 
529
527
    TextHTMLBuilder *hb = new TextHTMLBuilder();
530
528
    MarkupDirector *md = new MarkupDirector(hb);
531
 
    md->processDocument(te->document());
 
529
    md->processDocument(doc);
532
530
    QString result = hb->getResult();
533
531
 
534
532
    QRegExp regex = QRegExp( QLatin1String( "^<p>Foo</p>\\n<p>&nbsp;<p>&nbsp;<p>Bar</p>\\n$" ) );