Skip to content

Commit

Permalink
refs #89, fixing some test code issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Feb 7, 2021
1 parent 973abff commit 05f0aa8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/filesystem_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ struct StringMaker<fs::perms>
static std::string convert(fs::perms const& value) { return std::to_string(static_cast<unsigned int>(value)); }
};

template <>
struct StringMaker<fs::file_status>
{
static std::string convert(fs::file_status const& value) {
return std::string("[") + std::to_string(static_cast<unsigned int>(value.type())) + "," + std::to_string(static_cast<unsigned int>(value.permissions())) + "]";
}
};

#ifdef __cpp_lib_char8_t
template <>
struct StringMaker<char8_t>
Expand Down Expand Up @@ -1219,6 +1227,7 @@ TEST_CASE("30.10.11 class file_status", "[filesystem][file_status][fs.class.file
CHECK(fs.type() == fs::file_type::regular);
CHECK(fs.permissions() == fs::perms::unknown);
}
#if !defined(USE_STD_FS) || defined(GHC_FILESYSTEM_RUNNING_CPP20)
{
fs::file_status fs1{fs::file_type::regular, fs::perms::owner_read | fs::perms::owner_write | fs::perms::owner_exec};
fs::file_status fs2{fs::file_type::regular, fs::perms::owner_read | fs::perms::owner_write | fs::perms::owner_exec};
Expand All @@ -1228,6 +1237,7 @@ TEST_CASE("30.10.11 class file_status", "[filesystem][file_status][fs.class.file
CHECK_FALSE(fs1 == fs3);
CHECK_FALSE(fs1 == fs4);
}
#endif
}

TEST_CASE("30.10.12 class directory_entry", "[filesystem][directory_entry][fs.dir.entry]")
Expand Down

0 comments on commit 05f0aa8

Please sign in to comment.