diff options
author | louib <louib@users.noreply.github.com> | 2018-11-10 05:59:16 +0300 |
---|---|---|
committer | Jonathan White <droidmonkey@users.noreply.github.com> | 2018-11-10 05:59:16 +0300 |
commit | f06742cf41151417154b54f41d43d0db45c4812c (patch) | |
tree | ed58d148d71b706cf5faaaeec23801ca7877469c /tests/TestCli.cpp | |
parent | a7dd9f19f45c63e31df6c502a234aa62abc931c3 (diff) |
CLI Merge: Only save database file when modified. (#2466)
* Merge: detect if database was changed.
* Adding unit test.
* Only saving on change.
Diffstat (limited to 'tests/TestCli.cpp')
-rw-r--r-- | tests/TestCli.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/TestCli.cpp b/tests/TestCli.cpp index b1c3a82e8..36ca479d5 100644 --- a/tests/TestCli.cpp +++ b/tests/TestCli.cpp @@ -698,6 +698,15 @@ void TestCli::testMerge() QVERIFY(entry1); QCOMPARE(entry1->title(), QString("Some Website")); QCOMPARE(entry1->password(), QString("secretsecretsecret")); + + // making sure that the message is different if the database was not + // modified by the merge operation. + pos = m_stdoutFile->pos(); + Utils::Test::setNextPassword("a"); + mergeCmd.execute({"merge", "-s", sourceFile.fileName(), sourceFile.fileName()}); + m_stdoutFile->seek(pos); + m_stdoutFile->readLine(); + QCOMPARE(m_stdoutFile->readAll(), QByteArray("Database was not modified by merge operation.\n")); } void TestCli::testRemove() |