test-style
БесплатноБез исполняемых скриптовНе проверенHow kotatsu's tests are organized and written — levels (unit, system, integration), the module-first layout, dependency and trust rules, naming, zest checks…
от clice-io★ 37 звёзд на GitHubОб этом скилле
kotatsu Test Style
Levels
A test's level is decided by what it touches, not by the module it tests.
| Level | May touch | Lives in |
|---|---|---|
| unit | the process's memory; an event loop, its timers and in-memory transports count as memory | tests/<module>/unit/ → unit_tests |
| system | the operating system: files, processes, sockets, pipes, signals, threads and thread pools, environment | tests/<module>/system/ → system_tests |
| integration | several programs talking over real protocols, black box | tests/<module>/integration/ → ctest |
- The moment a test opens a file, spawns a process, binds a socket, installs a signal handler or starts a thread, it is a system test. zest's own I/O does not count: printing, and reading or writing snapshots through
zest::snapshot, are fine in a unit test. - Compile-time facts that must hold are
ZSTATIC_EXPECTin a unit case. - Nothing reaches the network beyond loopback. Tests that need the internet are not part of any suite.
- A target that must build without another, as ipc's codecs without the event loop, is checked by a program linked against it alone, without zest, which needs the loop; so is a check that replaces what a whole process shares, as fs's of remove_all() under failing allocations replaces the global operator new:
tests/<module>/<name>/main.cpp, run by ctest and Bazel as<module>_<name>(labelunit, orsystemfor one that touches the operating system); it prints each failed check and exits with 1. - zest's own runner check (
tests/zest/integration/) is integration-level, but it is the one integration test in C++ and CMake rather than TypeScript: it runs from CMake as a bootstrap stage (see Trust), so it needs nothing beyond the build.
Layout
Tests are grouped by module, then by level. tests/<module>/ mirrors include/kotatsu/<module>/; the modules are support, fs, sys, meta, codec with one directory per backend (codec/json, codec/toml, codec/fbs, codec/bincode, codec/blob, codec/dyn, codec/debug), cli, async, ipc with ipc/lsp, http and zest. tests/examples/ holds the tests of examples/, by the module an example shows (tests/examples/async/, tests/examples/ipc/): unit tests of what an example builds on, and the example programs run end to end. tests/harness/ holds what every module's integration tests share.
tests/<module>/
unit/<path mirroring the headers>/...
system/... same shape
integration/*.test.ts integration tests, TypeScript; nothing else but drivers/
integration/drivers/*.cpp the programs they spawn, one per file, or one per
directory of sources
<name>/main.cpp a check that is a program of its own (Levels),
in kotatsu_check_programs so that it builds into the
build root beside the runtime DLLs
harness/*.h, harness/*.ts helpers for this module's tests and the modules above,
integration tests' helpers included
CMakeLists.txt kotatsu_add_module_tests(LIBS <the module's libraries>)
kotatsu_add_integration_tests(LIBS ... PROGRAMS ...
DEBUG_ONLY ...) if it has integration/; PROGRAMS are
targets built elsewhere
tests/BUILD.bazel the same for Bazel: each module's harness library,
its <module>_<level>_tests binaries, its drivers and
its <module>_integration test
tests/harness/*.ts what every module's integration tests share
tests/fixtures/ types shared by several modules' tests
tests/snapshots/<suite>/ snapshot files
- The tests of header
<module>/a/b.hareunit/a/b_tests.cpp. A large header's tests split by aspect, intounit/a/b_<aspect>_tests.cppor into a directoryunit/a/b/<aspect>_tests.cpp. - codec's protocol (the core headers in
codec/,codec::repr, attributes, formats) is tested once, by a kit every backend runs:codec/harness/visit/kit.hholds the primitives andCaps, and each area (values.h,attrs.h,repr.h,variants.h,probing.h) registers its cases for a backend. A backend adapts itself incodec/<backend>/harness/backend.hand runs each area incodec/<backend>/unit/visit/<area>_tests.cpp, oneZEST_CASE_GROUPper file; blob, which lays out the struct itself rather than speaking the protocol, has novisit/tests. Fixtures only the codec's tests use live incodec/harness/fixtures/.
Установить test-style в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл test-style?
How kotatsu's tests are organized and written — levels (unit, system, integration), the module-first layout, dependency and trust rules, naming, zest checks, determinism. Read BEFORE writing, moving or reviewing any test.
Как установить скилл test-style?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл test-style запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic