mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-11-07 09:11:59 +00:00
* fix: Keep search paths in the specified order * chore: remove namespaces from tests * fix: alphabetical order in linker default paths for backwards compatibility * chore: extract AddPathsStringIfDistinct function * chore: make sure linker default source search path stays backwards compatible --------- Co-authored-by: Jan Laupetin <[email protected]>
22 lines
682 B
C++
22 lines
682 B
C++
#include "Utils/FileUtils.h"
|
|
|
|
#include <catch2/catch_test_macros.hpp>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
TEST_CASE("FileUtils: Parses paths string in specified order", "[fileutils]")
|
|
{
|
|
std::vector<std::string> paths;
|
|
|
|
REQUIRE(utils::ParsePathsString("zone_raw/b;zone_raw/a;\"raw;c\"", paths));
|
|
REQUIRE(paths == std::vector<std::string>{"zone_raw/b", "zone_raw/a", "raw;c"});
|
|
}
|
|
|
|
TEST_CASE("FileUtils: Parses paths string keeping first of duplicate paths", "[fileutils]")
|
|
{
|
|
std::vector<std::string> paths{"raw"};
|
|
|
|
REQUIRE(utils::ParsePathsString("zone_raw;raw;zone_raw;lang", paths));
|
|
REQUIRE(paths == std::vector<std::string>{"raw", "zone_raw", "lang"});
|
|
}
|