* feat(server): 外部皮肤接受跨平台客户端的 base 与装饰规则,社区皮肤可在 Windows 加载 社区皮肤库按跨平台客户端(msime 的 client-core)的规则校验,base 写的是全局主题 system / shuishan / light / paper / night / ink,而 Windows 只认六个内置皮肤 ID,所以社区里绝大多数皮肤在 Windows 上整包加载失败。 - base 为 system 时按 fluent 加载,配色原样保留。 - base 为五个内置全局主题时按 fluent 加载,并照 theme::resolve 换算配色:主题固定明暗,只取包里那一种明暗的配色,深浅两种模式都画它;读不懂的颜色当作没写,没写的按主题补齐,右键菜单和悬浮工具栏一并补上。包没声明那一种明暗时不生效,与客户端一致。 - 装饰规则与客户端对齐:空表或两个尺寸都为 0 表示无装饰;有尺寸而无 image 时用图片类型的 preview,都没有就不画。 - 复制 msime-cloud 的 client_dialect.json 作测试夹具,新测试要求客户端接受的每个包在 Windows 上都能加载;scripts/sync-client-dialect.py 负责同步,每周的 Skin client dialect 工作流比对上游。 * feat(server): 皮肤清单与跨平台客户端统一为同一套规则 同一个皮肤包现在在每个平台上要么都能加载,要么都被拒绝。规则以 msime client-core 的 load() 为准,共享用例表 client_dialect.json 改为从 msime 同步,测试要求每一条用例的接受与否都与客户端一致。 - 保留 ID 加上全局主题 ID(system、shuishan、light、paper、night、ink、custom)。 - 收紧到客户端的规则:skin.toml 最大 64 KiB;schema_version 必须是整数 1;author、description 写了不能为空;preview 写了必须指向包内已有的文件;toolbar_stylesheet 写了必须是包根目录里已有的 .css 文件;[license] 的各键有长度限制;[candidate] 与其中的 dark、light 必须是表;装饰图与背景图须是图片扩展名。 - 仓库自带的 7 个皮肤、示例皮肤和 msime-skins 里的 4 个皮肤在新规则下都能加载。
Tests
This project now includes a lightweight regression test target wired into the main CMake build.
What It Covers
Current tests focus on high-value IME behaviors that are easy to accidentally break during refactors:
shuangpinscheme request constructionquanpinscheme request construction- case-preserving shuangpin segmentation
- full-helpcode detection
engine + shuangpincontinuation behavior- cloud suggestion trigger timing for shuangpin
The goal is not to fully simulate the whole IME UI pipeline yet. The goal is to protect the core input rules and session behavior.
Build and run
Run these commands from the MSIME-Windows repository root after preparing
vcpkg and Boost with python server/scripts/prepare_env.py:
python scripts/product_lock.py fetch-dictionaries --staging-root .
if ($LASTEXITCODE -ne 0) { throw 'Dictionary verification failed' }
$env:LOCALAPPDATA = Join-Path $PWD 'build/test-data/user-local'
$env:METASEQUOIA_IME_DATA_DIR = Join-Path $env:LOCALAPPDATA 'metasequoiaime'
New-Item -ItemType Directory -Force $env:METASEQUOIA_IME_DATA_DIR | Out-Null
Copy-Item MetasequoiaImeDict/out/* $env:METASEQUOIA_IME_DATA_DIR -Force
Copy-Item engine/helpcode/helpcodes $env:METASEQUOIA_IME_DATA_DIR -Recurse -Force
Copy-Item server/assets/tables/* $env:METASEQUOIA_IME_DATA_DIR -Force
Copy-Item server/assets/config/config.toml $env:METASEQUOIA_IME_DATA_DIR -Force
.\server\tests\scripts\llaunch.ps1 -Configuration Release
Use a dedicated PowerShell terminal: these environment variables isolate both Windows helpers and the shared Engine from the installed user's data for the rest of that session. The scripts run CTest; they do not launch the interactive Server, install or register the input method. CI additionally runs the native Win32/x64 pipe probe after building the full Server.
Tests belong to the Server CMake project, which provides the Engine, GUI and
third-party targets. server/tests/CMakeLists.txt is an add_subdirectory input,
not an independent project. The obsolete test presets have been removed; an old
locally generated server/tests/CMakePresets.json is no longer used.
Once test data is prepared, the convenience scripts work from any directory:
.\server\tests\scripts\llaunch.ps1 -Configuration Release # build, then CTest
.\server\tests\scripts\lrun.ps1 -Configuration Release # CTest only
Omitting -Configuration selects Debug in server/build; Release uses
server/build-release. Both compile MetasequoiaImeServerTests and
test_webview_contract in the parent build tree. Configuration, compilation,
test failures and an empty CTest registry return failure rather than launching a
stale executable or reporting success.
The equivalent direct CTest command from the repository root is:
ctest --test-dir server/build-release -C Release --output-on-failure --no-tests=error
Test Layout
tests/src/main.cpp- tiny custom test runner
tests/includes/test_framework.h- lightweight assertion helpers
tests/src/test_shuangpin_scheme.cpp- shuangpin scheme unit tests
tests/src/test_quanpin_scheme.cpp- quanpin scheme unit tests
tests/src/test_shuangpin_query.cpp- query/helper function tests
tests/src/test_engine_shuangpin_session.cpp- session-level behavior tests
Recommended Practice
When you change input behavior, add a regression test if the change affects:
- input segmentation
- space/enter/backspace behavior
- helpcode handling
- continuation after candidate selection
- create-word flow
- cloud suggestion timing
The best tests in this project are the ones that capture a concrete input example that previously broke.