Access test case name from test case body
- Dominant language
- Rust
- Stars
- 633
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
Example code
```rust
#[test_case(vec![(1,1),(2,2),(3,3)].iter().collect(), vec![(1,1),(2,2),(3,3)].iter().collect() ; "test")]
fn get_changes_values<
'a,
'b,
K: Eq + Ord + Clone + fmt::Debug,
V: Eq + fmt::Debug,
>(
old: &'b BTreeMap<&'a K, V>,
new: &'b BTreeMap<&'a K, V>,
) {
let changes = super::get_changes_values(old, new);
// test_case => "test"
assert_debug_snapshot(test_case, changes);
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the test_case procedural macro implementation and trace how the attribute body is parsed and expanded. Use the example in the issue as the behavioral reference; done means the generated test body can access the case name as shown by the snapshot assertion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100