Files
msime-windows/server/tests
fanlusky 5c02503139 Render the candidate window with D2D instead of WebView2
Drive the existing candidate HWND through CandidatePresenter and msimeui,
keep WebView2 for the menu, floating toolbar, and settings, and load
external skins from skin.toml color tokens. Restore cloud/AI badges on
D2D items, and keep click, pin, fix-position, and delete on the same
window messages as before.
2026-09-02 15:30:03 +08:00
..
2026-06-20 22:11:00 +08:00
2025-05-30 23:03:58 +08:00
2026-06-20 22:11:00 +08:00
2025-04-20 17:44:33 +08:00
2026-06-20 22:11:00 +08:00
2025-04-20 17:44:33 +08:00
2025-04-21 18:32:45 +08:00

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:

  • shuangpin scheme request construction
  • quanpin scheme request construction
  • case-preserving shuangpin segmentation
  • full-helpcode detection
  • engine + shuangpin continuation 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 The Tests

From the repository root:

cmake --build build --config Debug --target MetasequoiaImeServerTests

Run The Tests

Recommended:

ctest --test-dir build -C Debug --output-on-failure

You can also run from inside the build directory:

cd build
ctest -C Debug --output-on-failure

Common Pitfall

If you run ctest from the source root directly, you may see:

No tests were found!!!

That usually means ctest is looking at the source directory instead of the build directory.

Use one of these instead:

ctest --test-dir build -C Debug --output-on-failure

or

cd build
ctest -C Debug --output-on-failure

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

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.