mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-20 09:19:48 +00:00
UnitTests/FS: Add path validity and splitting tests
This commit is contained in:
parent
484cfb9328
commit
d4ba0acb3a
2 changed files with 59 additions and 0 deletions
|
@ -136,6 +136,19 @@ struct SplitPathResult
|
|||
std::string parent;
|
||||
std::string file_name;
|
||||
};
|
||||
inline bool operator==(const SplitPathResult& lhs, const SplitPathResult& rhs)
|
||||
{
|
||||
const auto fields = [](const SplitPathResult& obj) {
|
||||
return std::tie(obj.parent, obj.file_name);
|
||||
};
|
||||
return fields(lhs) == fields(rhs);
|
||||
}
|
||||
|
||||
inline bool operator!=(const SplitPathResult& lhs, const SplitPathResult& rhs)
|
||||
{
|
||||
return !(lhs == rhs);
|
||||
}
|
||||
|
||||
/// Split a path into a parent path and the file name. Takes a *valid non-root* path.
|
||||
///
|
||||
/// Example: /shared2/sys/SYSCONF => {/shared2/sys, SYSCONF}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue