mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-30 22:43:24 +02:00
Unit Tests
- Now sorts the results of a glob, so that the results are in a consistent order on all platforms.
This commit is contained in:
parent
abffaa184b
commit
5a886f6e58
1 changed files with 3 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <algorithm>
|
||||
#include <Context.h>
|
||||
#include <Directory.h>
|
||||
#include <test.h>
|
||||
|
@ -70,12 +71,14 @@ int main (int argc, char** argv)
|
|||
|
||||
// std::vector <std::string> list ();
|
||||
std::vector <std::string> files = d5.list ();
|
||||
std::sort (files.begin (), files.end ());
|
||||
t.is ((int)files.size (), 2, "Directory::list 1 file");
|
||||
t.is (files[0], "/tmp/test_directory/dir", "file[0] is /tmp/test_directory/dir");
|
||||
t.is (files[1], "/tmp/test_directory/f0", "file[1] is /tmp/test_directory/f0");
|
||||
|
||||
// std::vector <std::string> listRecursive ();
|
||||
files = d5.listRecursive ();
|
||||
std::sort (files.begin (), files.end ());
|
||||
t.is ((int)files.size (), 2, "Directory::list 1 file");
|
||||
t.is (files[0], "/tmp/test_directory/dir/f1", "file is /tmp/test_directory/dir/f1");
|
||||
t.is (files[1], "/tmp/test_directory/f0", "file is /tmp/test_directory/f0");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue