Skip to content

Commit

Permalink
Added new test case for NeovimConnector
Browse files Browse the repository at this point in the history
  • Loading branch information
equalsraf committed May 3, 2015
1 parent 002fbed commit 74ed43b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ function(add_xtest SOURCE_NAME)
endfunction()

add_xtest(tst_neovimobject)
add_xtest(tst_neovimconnector)
add_xtest(tst_callallmethods)
add_xtest(tst_encoding)
add_xtest(tst_msgpackiodevice)
31 changes: 31 additions & 0 deletions test/tst_neovimconnector.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include <QTest>
#include <QSignalSpy>
#include <QTcpServer>
#include <QTcpSocket>
#include <QRegularExpression>
#include <QBuffer>

#include <neovimconnector.h>

namespace NeovimQt {

class Test: public QObject
{
Q_OBJECT
private slots:

void reconnect() {
NeovimConnector c(new QBuffer());
QCOMPARE(c.canReconnect(), false);

NeovimConnector *spawned = NeovimConnector::spawn();
QCOMPARE(spawned->canReconnect(), true);

spawned->reconnect();
}

};

} // Namespace NeovimQt
QTEST_MAIN(NeovimQt::Test)
#include "tst_neovimconnector.moc"

0 comments on commit 74ed43b

Please sign in to comment.