diff options
author | Balazs Gyurak <ba32107@gmail.com> | 2019-06-19 03:42:19 +0300 |
---|---|---|
committer | Jonathan White <support@dmapps.us> | 2019-06-19 03:42:19 +0300 |
commit | 05c11d1b7c4e53ac9a3207bb9a20cf79d8db9492 (patch) | |
tree | a2c89ae32e09571f2b3a8cd3f786fd2466e258a1 /tests/TestCli.cpp | |
parent | 1e915eef89ab6d076a8313f314180a051dcba8ef (diff) |
CLI: Add 'flatten' option to the 'ls' command (#3276)
* Fixes #925
* Add 'flatten' option to CLI ls command
* Add test for Group::hierarchy() and man page for ls --flatten
* Rename group sort test to align with others
Diffstat (limited to 'tests/TestCli.cpp')
-rw-r--r-- | tests/TestCli.cpp | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/tests/TestCli.cpp b/tests/TestCli.cpp index b1da5f1a1..530e1eabe 100644 --- a/tests/TestCli.cpp +++ b/tests/TestCli.cpp @@ -847,7 +847,38 @@ void TestCli::testList() "eMail/\n" " [empty]\n" "Homebanking/\n" - " [empty]\n")); + " Subgroup/\n" + " Subgroup Entry\n")); + + pos = m_stdoutFile->pos(); + Utils::Test::setNextPassword("a"); + listCmd.execute({"ls", "-R", "-f", m_dbFile->fileName()}); + m_stdoutFile->seek(pos); + m_stdoutFile->readLine(); // skip password prompt + QCOMPARE(m_stdoutFile->readAll(), + QByteArray("Sample Entry\n" + "General/\n" + "General/[empty]\n" + "Windows/\n" + "Windows/[empty]\n" + "Network/\n" + "Network/[empty]\n" + "Internet/\n" + "Internet/[empty]\n" + "eMail/\n" + "eMail/[empty]\n" + "Homebanking/\n" + "Homebanking/Subgroup/\n" + "Homebanking/Subgroup/Subgroup Entry\n")); + + pos = m_stdoutFile->pos(); + Utils::Test::setNextPassword("a"); + listCmd.execute({"ls", "-R", "-f", m_dbFile->fileName(), "/Homebanking"}); + m_stdoutFile->seek(pos); + m_stdoutFile->readLine(); // skip password prompt + QCOMPARE(m_stdoutFile->readAll(), + QByteArray("Subgroup/\n" + "Subgroup/Subgroup Entry\n")); pos = m_stdoutFile->pos(); Utils::Test::setNextPassword("a"); @@ -921,7 +952,8 @@ void TestCli::testLocate() locateCmd.execute({"locate", tmpFile.fileName(), "Entry"}); m_stdoutFile->seek(pos); m_stdoutFile->readLine(); // skip password prompt - QCOMPARE(m_stdoutFile->readAll(), QByteArray("/Sample Entry\n/General/New Entry\n")); + QCOMPARE(m_stdoutFile->readAll(), + QByteArray("/Sample Entry\n/General/New Entry\n/Homebanking/Subgroup/Subgroup Entry\n")); } void TestCli::testMerge() |