mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-08 23:57:05 +00:00
APITests: Test FHU::LexicallyNormal
This commit is contained in:
parent
ea275bbdcc
commit
12b710ed16
@ -1,5 +1,7 @@
|
||||
set (TESTS
|
||||
InterruptableConditionVariable)
|
||||
InterruptableConditionVariable
|
||||
LexicallyNormal
|
||||
)
|
||||
|
||||
list(APPEND LIBS FEXCore)
|
||||
|
||||
|
30
unittests/APITests/LexicallyNormal.cpp
Normal file
30
unittests/APITests/LexicallyNormal.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
#include <catch2/catch.hpp>
|
||||
#include <filesystem>
|
||||
#include <FEXHeaderUtils/Filesystem.h>
|
||||
|
||||
#define TestPath(Path) \
|
||||
REQUIRE(std::string_view(FHU::Filesystem::LexicallyNormal(Path)) == std::string_view(std::filesystem::path(Path).lexically_normal().string()));
|
||||
|
||||
TEST_CASE("LexicallyNormal") {
|
||||
TestPath("");
|
||||
TestPath("/");
|
||||
TestPath("/./");
|
||||
TestPath("//.");
|
||||
TestPath("//./");
|
||||
TestPath("//.//");
|
||||
|
||||
TestPath(".");
|
||||
TestPath("..");
|
||||
TestPath(".//");
|
||||
TestPath("../../");
|
||||
TestPath("././");
|
||||
TestPath("./../");
|
||||
TestPath("./../");
|
||||
TestPath("./.././.././.");
|
||||
TestPath("./.././.././..");
|
||||
|
||||
TestPath("./foo/../");
|
||||
TestPath("foo/./bar/..");
|
||||
TestPath("foo/.///bar/..");
|
||||
TestPath("foo/.///bar/../");
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user