BOOST_REQUIRE( is_checksum( file.path(), file_md5 ) );
}
+void pathinfo_is_exist_test()
+{
+ TmpDir dir;
+ Pathname subdir("text with spaces");
+ // create a fake file
+ BOOST_CHECK_EQUAL( filesystem::mkdir(dir.path() + subdir), 0 );
+
+ Pathname filepath = (dir.path() + subdir+ "filename");
+ ofstream str(filepath.asString().c_str(),ofstream::out);
+ str << "foo bar" << endl;
+ str.flush();
+ str.close();
+
+ BOOST_CHECK( PathInfo(filepath).isExist() );
+}
+
void pathinfo_misc_test()
{
TmpDir dir;
+
+
+
PathInfo info(dir.path());
BOOST_CHECK(info.isDir());
}
test_suite* test= BOOST_TEST_SUITE( "PathInfoTest" );
test->add( BOOST_TEST_CASE( &pathinfo_checksum_test ), 0 /* expected zero error */ );
test->add( BOOST_TEST_CASE( &pathinfo_misc_test ), 0 /* expected zero error */ );
+ test->add( BOOST_TEST_CASE( &pathinfo_is_exist_test ), 0 /* expected zero error */ );
return test;
}