Files
FEX-Emu--FEX/unittests/APITests/LexicallyNormal.cpp
T
2023-03-30 16:28:34 -07:00

32 lines
553 B
C++

#include <catch2/catch.hpp>
#include <filesystem>
#include <FEXHeaderUtils/Filesystem.h>
#define TestPath(Path) \
TEST_CASE("LexicallyNormal") {
auto Path = GENERATE("",
"/",
"/./",
"//.",
"//./",
"//.//",
".",
"..",
".//",
"../../",
"././",
"./../",
"./../",
"./.././.././.",
"./.././.././..",
"./foo/../",
"foo/./bar/..",
"foo/.///bar/..",
"foo/.///bar/../");
REQUIRE(std::string_view(FHU::Filesystem::LexicallyNormal(Path)) == std::string_view(std::filesystem::path(Path).lexically_normal().string()));
}