一键导入
add-test
Create a new Verona compiler test case. Use when the user wants to add a test, create a test, or scaffold a test for the compiler.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Create a new Verona compiler test case. Use when the user wants to add a test, create a test, or scaffold a test for the compiler.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Verona compiler coding conventions, C++ style, trieste patterns, and project structure. Applies when writing or reviewing Verona compiler code.
Structured debugging protocol with checkpoints. Load when debugging non-trivial issues — before forming any hypothesis about the cause.
Verona compiler test suite infrastructure — running tests, updating golden files, verifying pass completeness, checking error codes. Use when debugging test failures, regenerating golden files, or understanding the test framework.
Patterns, pitfalls, and idioms for writing Verona source code (.v files). Use when writing library code, _builtin types, or user programs.
Patterns, pitfalls, and idioms for writing Verona source code (.v files). Use when writing library code, _builtin types, or user programs.
Verona compiler type inference model — bidirectional refinement, per-function inference, lambda/context propagation, algebraic and structural typing, generics, and debugging. Use when changing or debugging `vc/passes/infer.cc` or investigating type inference failures.
| name | add-test |
| description | Create a new Verona compiler test case. Use when the user wants to add a test, create a test, or scaffold a test for the compiler. |
| argument-hint | <test-name> [error|ffi] |
Create a new test case in testsuite/v/ for the Verona compiler.
$0 — the test name (required, snake_case)$1 — if set to error, creates a compile-error test (exit code 1, no run/ directory). If set to ffi, creates a test that uses FFI builtins.Create testsuite/v/$0/$0.v with appropriate Verona source code.
Conventions:
use "https://...")_builtin typesuse "_builtin" — it is always implicitly availablefor, if, while)0 not usize 0)myclass[T] { ... }val: T;new uses new { field = val } (no class name after new)Type(args) constructor sugar: callback(f) instead of callback::create(f)(obj.field)(args) for apply on field access, x.method for zero-arg methodsFor success tests (default):
var result = 0; then if cond { result = result + N; } with powers of 2main function must return i32For compile-error tests ($1 = error):
For FFI tests ($1 = ffi):
:::name(...) syntax) or _builtin/ffi/ wrappers (e.g., ffi::add_external())use block with a Lib stringffi::func_name(args) for functions in _builtin/ffi/Run from the build directory:
cd build
ninja install && ninja update-dump-clean && ninja update-dump && cmake ..
This auto-generates the golden file directory structure:
testsuite/v/$0/$0/compile/ — contains exit_code.txt, stdout.txt, stderr.txt, pass dump files (00_parse.trieste through 13_typecheck.trieste), *_final.trieste, and .vbc file (success tests only)testsuite/v/$0/$0/run/ — contains exit_code.txt, stdout.txt, stderr.txt (only for success tests that produce a .vbc)Check that the golden compile/ directory has the expected files:
00_parse.trieste through 13_typecheck.trieste*_final.triesteexit_code.txt (value 0 for success, 1 for error, no trailing newline)stdout.txt and stderr.txt*.vbc file (success tests only)If pass dumps are missing (e.g., only 0–5 present), it usually means a WF violation in a later pass. Investigate with dist/vc/vc build ../testsuite/v/$0 --dump_passes=dump_$0 to see which pass fails.
For error tests: no run/ directory, no .vbc file, exit_code.txt = 1.
cd build && ctest --output-on-failure -R "^vbc/$0" -j$(nproc)
This should show the test passing. If it fails, check the source code and re-run ninja update-dump.
State the test name, whether it's a success/error/ffi test, what it tests, and the expected exit code.