Files
msime-windows/server/tests/includes/test_utf8_path.h
T
fanlusky ac8394291b fix(tests): keep the shared test header free of engine dependencies
The portable test target builds on a bare Linux runner with no vcpkg tree, so
the UTF-8 path helper cannot live in test_framework.h -- including the engine's
data_path.h there broke the sanitizer build. Move it to test_utf8_path.h, which
only the Windows tests that need it include.
2026-09-09 04:48:56 +08:00

19 lines
648 B
C++

#pragma once
#include "MetasequoiaImeEngine/core/data_path.h"
#include <filesystem>
#include <string>
namespace test
{
// Every dictionary/engine API takes its paths as UTF-8. path::string() converts through the ANSI
// code page instead, which corrupts a non-ASCII path and throws outright on a code page that cannot
// represent the characters -- and the fixtures using this all live under the temp directory, which
// sits inside the user profile. Tests must therefore convert with this, never with path::string().
inline std::string Utf8(const std::filesystem::path &path)
{
return metasequoia::path_to_utf8(path);
}
} // namespace test