Commit cfdbdc7e authored by hjk's avatar hjk Committed by con

fakevim: fix broken auto tests

(cherry picked from commit 0422c833)
parent d46b30a2
......@@ -571,7 +571,6 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
key += 32;
}
m_undoCursorPosition[m_tc.document()->revision()] = m_tc.position();
//if (m_mode == InsertMode)
// joinPreviousEditBlock();
//else
......@@ -656,6 +655,7 @@ void FakeVimHandler::Private::restoreWidget()
EventResult FakeVimHandler::Private::handleKey(int key, int unmodified,
const QString &text)
{
m_undoCursorPosition[m_tc.document()->revision()] = m_tc.position();
//qDebug() << "KEY: " << key << text << "POS: " << m_tc.position();
if (m_mode == InsertMode)
return handleInsertMode(key, unmodified, text);
......
......@@ -291,7 +291,6 @@ void tst_FakeVim::command_dd_2()
move("j", "@" + l[1]);
check("dd", l[0] + "\n@" + lmid(2));
check("p", l[0] + "\n" + l[2] + "\n@" + l[1] + "\n" + lmid(3));
return; // FIXME
check("u", l[0] + "\n@" + lmid(2));
}
......@@ -318,8 +317,6 @@ void tst_FakeVim::command_dfx_down()
check("df ", l[0] + "\n#inc@<QtCore>\n" + lmid(2));
check("j", l[0] + "\n#inc<QtCore>\n#inc@lude <QtGui>\n" + lmid(3));
check(".", l[0] + "\n#inc<QtCore>\n#inc@<QtGui>\n" + lmid(3));
qWarning("FIXME");
return;
check("u", l[0] + "\n#inc<QtCore>\n#inc@lude <QtGui>\n" + lmid(3));
check("u", l[0] + "\n#inc@lude <QtCore>\n" + lmid(2));
}
......@@ -366,9 +363,8 @@ void tst_FakeVim::command_i()
// small insertion at start of document
check("ix" + escape, "@x" + lines);
check("u", "@" + lines);
// FIXME redo broken
//check(control('r'), "@x" + lines);
//check("u", "@" + lines);
check(control('r'), "@x" + lines);
check("u", "@" + lines);
// small insertion at start of document
check("ixxx" + escape, "xx@x" + lines);
......@@ -386,9 +382,8 @@ void tst_FakeVim::command_i()
check("icyy" + escape, "bcy@yxa" + lines);
check("u", "b@xa" + lines);
check("u", "@a" + lines);
// FIXME undo broken
// checkEx("redo", "b@xa" + lines);
// check("u", "@a" + lines);
checkEx("redo", "b@xa" + lines);
check("u", "@a" + lines);
}
void tst_FakeVim::command_left()
......@@ -470,19 +465,6 @@ return; // FIXME
check("G", lmid(0) + "@");
check("yyp", lmid(0) + "@" + lmid(9, 1));
}
/*
#include <QtCore>
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
return app.exec();
}
*/
void tst_FakeVim::test_i_cw_i()
{
......@@ -496,6 +478,19 @@ return; // FIXME: not in sync with Gui behaviour?
}
/*
#include <QtCore>
#include <QtGui>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
return app.exec();
}
*/
//////////////////////////////////////////////////////////////////////////
//
// Main
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment