diff --git a/src/filesystem.hpp b/src/filesystem.hpp index a09710c..d8501b0 100644 --- a/src/filesystem.hpp +++ b/src/filesystem.hpp @@ -16,7 +16,7 @@ public: static std::string escape_argument(const std::string &argument); static std::string unescape_argument(const std::string &argument); - /// Does not resolve symbolic links. Returns empty path on failure + /// Does not resolve symbolic links. Returns empty path on failure. static boost::filesystem::path get_current_path() noexcept; /// Returns empty path on failure static boost::filesystem::path get_home_path() noexcept; diff --git a/tests/filesystem_test.cpp b/tests/filesystem_test.cpp index 166c852..c83c60f 100644 --- a/tests/filesystem_test.cpp +++ b/tests/filesystem_test.cpp @@ -6,6 +6,12 @@ int main() { auto home_path = filesystem::get_home_path(); g_assert(!home_path.empty()); } + { + auto home_path = filesystem::get_current_path(); + g_assert(!home_path.empty()); + g_assert(boost::filesystem::exists(home_path)); + g_assert(boost::filesystem::is_directory(home_path)); + } { auto original = "test () '\"";