diff options
author | Tim Mayberry <mojofunk@gmail.com> | 2014-06-24 21:27:37 +1000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-06-25 12:40:11 -0400 |
commit | 24c40c0e88ce25d79608c09b7dbc6b63009dab24 (patch) | |
tree | eba5230e97b3a99c9a1cde66ce40d8576ce38924 | |
parent | 31bceb7570e314e5e98282b5ad21851043dd1250 (diff) |
Add simple test for PBD::find_files_matching_pattern
This helped fix a silly cut and paste error in pbd/file_utils.cc so
might as well included it.
-rw-r--r-- | libs/pbd/test/filesystem_test.cc | 12 | ||||
-rw-r--r-- | libs/pbd/test/filesystem_test.h | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/libs/pbd/test/filesystem_test.cc b/libs/pbd/test/filesystem_test.cc index 8fe5afab21..e30aa2b1af 100644 --- a/libs/pbd/test/filesystem_test.cc +++ b/libs/pbd/test/filesystem_test.cc @@ -84,3 +84,15 @@ FilesystemTest::testCopyFileUTF8Filename () CPPUNIT_ASSERT (PBD::copy_file (input_path, output_path)); } } + +void +FilesystemTest::testFindFilesMatchingPattern () +{ + vector<string> patch_files; + + PBD::find_files_matching_pattern (patch_files, test_search_path (), "*PatchFile*"); + + CPPUNIT_ASSERT(test_search_path ().size() == 1); + + CPPUNIT_ASSERT(patch_files.size() == 2); +} diff --git a/libs/pbd/test/filesystem_test.h b/libs/pbd/test/filesystem_test.h index a8b3968f3a..588e731af2 100644 --- a/libs/pbd/test/filesystem_test.h +++ b/libs/pbd/test/filesystem_test.h @@ -7,12 +7,13 @@ class FilesystemTest : public CppUnit::TestFixture CPPUNIT_TEST (testPathIsWithin); CPPUNIT_TEST (testCopyFileASCIIFilename); CPPUNIT_TEST (testCopyFileUTF8Filename); + CPPUNIT_TEST (testFindFilesMatchingPattern); CPPUNIT_TEST_SUITE_END (); public: void testPathIsWithin (); void testCopyFileASCIIFilename (); void testCopyFileUTF8Filename (); - + void testFindFilesMatchingPattern (); }; |