Commit 08063cdd authored by Laurent Montel's avatar Laurent Montel 😁

Continue to implement regexpeditorlineedit

parent f44663ea
......@@ -40,4 +40,20 @@ void RegexpEditorLineEditTest::shouldHaveDefaultValue()
QCOMPARE(mainLayout->margin(), 0);
}
void RegexpEditorLineEditTest::shouldChangeValue_data()
{
QTest::addColumn<QString>("input");
QTest::newRow("empty") << QString();
QTest::newRow("test1") << QStringLiteral("foo");
}
void RegexpEditorLineEditTest::shouldChangeValue()
{
QFETCH(QString, input);
KSieveUi::RegexpEditorLineEdit w;
w.setCode(input);
QCOMPARE(w.code(), input);
}
QTEST_MAIN(RegexpEditorLineEditTest)
......@@ -30,6 +30,8 @@ public:
~RegexpEditorLineEditTest() = default;
private Q_SLOTS:
void shouldHaveDefaultValue();
void shouldChangeValue();
void shouldChangeValue_data();
};
#endif // REGEXPEDITORLINEEDITTEST_H
......@@ -41,16 +41,15 @@ RegexpEditorLineEdit::~RegexpEditorLineEdit()
void RegexpEditorLineEdit::switchToRegexpEditorLineEdit()
{
//TODO
//Nothing here
}
void KSieveUi::RegexpEditorLineEdit::setCode(const QString &str)
{
//TODO
mLineEdit->setText(str);
}
QString KSieveUi::RegexpEditorLineEdit::code() const
{
//TODO
return {};
return mLineEdit->text();
}
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