anthonyoteri / anthonyoteri/cargo-rigtest
Data-driven case generation from a compile-time data set (#[cases_from])
- 主要語言
- Rust
- 星號
- 0
- 分支
- 0
- 平均合併
- 3 天 18 小時
- 30 天內合併 PR
- 8
描述
Follow-up to #95 (split out from the cartesian `#[values]` work in #109).
## Problem
Part A of #95 (cartesian `#[values]`) is implemented. Part B — generating one case per element of a build-time-known data set, e.g. `#[cases_from(CONST)]` over a `const CASES: &[(...)]` — was deferred because a proc macro **cannot read the contents (or length) of a referenced `const`**; it only sees the identifier token. Expanding N `TestCase` statics at compile time therefore isn't possible from a `const` reference without breaking the one-static-per-case model (which per-case naming, filtering, parallelism, and retry all depend on).
## Possible reshaped surfaces (need a design decision)
1. Accept an **inline array literal** in the attribute so the macro sees the tokens directly: `#[cases_from([("alice", 1), ("bob", 2)])]`.
2. A declarative `cases! { ... }` macro the user writes with the literal data.
3. Some codegen/build-script approach if a true external data set (e.g. per fixture file) is needed.
Blocked on choosing a surface; not implementable as literally specified in #95.
貢獻指南
研究方向
Start by reading issues #95 and #109 to understand the deferred cartesian #[values] work and the one-static-per-case constraints. Compare the three proposed surfaces—inline array literals, a declarative cases! macro, and build-script or codegen support—and document a decided API and implementation direction; no source file or test is named yet.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- rust
- 領域
- testing-qa
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 冷清
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100