message: util: Add StripRedundantLastElementsOfPath function
diff: @@ -42,6 +42,28 @@ namespace BCLog {
  BOOST_FIXTURE_TEST_SUITE(util_tests, BasicTestingSetup)
  +BOOST_AUTO_TEST_CASE(util_datadir)
  +{
  + ClearDatadirCache();
  + const fs::path dd_norm = GetDataDir();
  +
  + gArgs.ForceSetArg("-datadir", dd_norm.string() + "/");
  + ClearDatadirCache();
  + BOOST_CHECK_EQUAL(dd_norm, GetDataDir());
  +
  + gArgs.ForceSetArg("-datadir", dd_norm.string() + "/.");
  + ClearDatadirCache();
  + BOOST_CHECK_EQUAL(dd_norm, GetDataDir());
  +
  + gArgs.ForceSetArg("-datadir", dd_norm.string() + "/./");
  + ClearDatadirCache();
  + BOOST_CHECK_EQUAL(dd_norm, GetDataDir());
  +
  + gArgs.ForceSetArg("-datadir", dd_norm.string() + "/.//");
  + ClearDatadirCache();
  + BOOST_CHECK_EQUAL(dd_norm, GetDataDir());
  +}
  +
  BOOST_AUTO_TEST_CASE(util_check)
  {
  // Check that Assert can forward
  