summaryrefslogtreecommitdiff
path: root/libs/pbd/test
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2014-06-24 21:27:37 +1000
committerPaul Davis <paul@linuxaudiosystems.com>2014-06-25 12:40:11 -0400
commit24c40c0e88ce25d79608c09b7dbc6b63009dab24 (patch)
treeeba5230e97b3a99c9a1cde66ce40d8576ce38924 /libs/pbd/test
parent31bceb7570e314e5e98282b5ad21851043dd1250 (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.
Diffstat (limited to 'libs/pbd/test')
-rw-r--r--libs/pbd/test/filesystem_test.cc12
-rw-r--r--libs/pbd/test/filesystem_test.h3
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 ();
};