13
0

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.
This commit is contained in:
Tim Mayberry 2014-06-24 21:27:37 +10:00 committed by Paul Davis
parent 31bceb7570
commit 24c40c0e88
2 changed files with 14 additions and 1 deletions

View File

@ -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);
}

View File

@ -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 ();
};