mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-30 13:08:07 -06:00
Text: the Japanese fallback test pins ja-JP (#2039)
The test checked that Japanese text falls back to an installed Japanese family, but left the process-global CJK locale at the host's: on a zh-CN host with a Chinese face installed, han_order puts the Chinese families first for the shared ideographs and the Japanese-family assertion fails. Set ja-JP under the TEST_CJK_LOCALE lock and clear the request when the test ends, as the zh-CN test beside it does. Tests: effectcraft-text 75 lib + 3 integration passed; cargo fmt --all -- --check passed.
This commit is contained in:
@@ -1179,7 +1179,11 @@ mod tests {
|
||||
/// loaded a CJK font first. Skipped where no family from the list is installed.
|
||||
#[test]
|
||||
fn cjk_falls_back_to_a_system_family() {
|
||||
// Japanese text must reach the Japanese list even on a Chinese-language host, where the
|
||||
// ambient locale puts the Chinese families first for the shared ideographs.
|
||||
let _locale = TEST_CJK_LOCALE.lock().unwrap_or_else(|e| e.into_inner());
|
||||
set_cjk_locale("ja-JP");
|
||||
let _reset = LocaleReset;
|
||||
scan_system();
|
||||
let inter = resolve("Inter", "Bold").face;
|
||||
let installed = JAPANESE_FAMILIES.iter().any(|f| resolve_in(f, "Regular").is_some());
|
||||
|
||||
Reference in New Issue
Block a user