Rely on std::filesystem for file_utils (#3042)

Co-authored-by: Andrew Johnson <git.vyveu@simplelogin.com>
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Andrew Johnson 2025-01-27 23:31:59 -08:00 committed by GitHub
parent a8768b7845
commit 8626ce5c43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 53 additions and 67 deletions

View file

@ -30,3 +30,12 @@ TEST_CASE("Test file_exists")
// Note: not clear how to portably test where a file should exist.
REQUIRE(!file_exists("./should_not_exist/really_do_not_make_this_please"));
}
TEST_CASE("Test dir_name")
{
REQUIRE(dir_name("") == "");
REQUIRE(dir_name("/") == "/");
REQUIRE(dir_name("hello") == "");
REQUIRE(dir_name("hello/world") == "hello");
REQUIRE(dir_name("/path/to/dir/") == "/path/to/dir");
}