Skip to content

Commit fb95319

Browse files
committed
docs(former): Add test matrix for tuple enum variants
1 parent 97c68ca commit fb95319

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

module/core/former/plan.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,31 @@ This plan focuses on verifying the behavior for **Tuple Variants**. The relevant
8585
* T1.7 (Default, T1 not Former + Standalone): Rule 3d.ii, 4 (Needs specific test file if not covered implicitly)
8686
* T1.8 (`#[scalar]` + Standalone): Rule 1d, 4 (`standalone_constructor_args_*`)
8787
* T1.9 (`#[subform_scalar]`, T1 derives Former + Standalone): Rule 2d, 4 (Needs specific test file if not covered implicitly)
88-
* T1.10 (`#[subform_scalar]`, T1 not Former + Standalone): Rule 2d (Error - Covered by T1.5)
89-
* **Multi-Field (`V(T1, T2, ...)`):**
90-
* TN.1 (Default): Rule 3f (Needs specific test file if not covered implicitly by TN.4)
91-
* TN.2 (`#[scalar]`): Rule 1f (`keyword_variant_*`, `standalone_constructor_args_*`)
92-
* TN.3 (`#[subform_scalar]`): Rule 2f (Error - `compile_fail/tuple_multi_subform_scalar_error.rs`)
93-
* TN.4 (Default + Standalone): Rule 3f, 4 (Needs specific test file, potentially `standalone_constructor_args_*` if adapted)
94-
* TN.5 (`#[scalar]` + Standalone): Rule 1f, 4 (`standalone_constructor_args_*`)
88+
* T1.10| `#[subform_scalar]`| No | `#[standalone_constructors]`| *Compile Error* | *Compile Error* | 2d | (Dispatch) |
89+
90+
Note: The effect of `#[arg_for_constructor]` is covered by Rule 4 in conjunction with the base behavior.
91+
92+
---
93+
94+
**Combinations for Multi-Field Tuple Variants (`V(T1, T2, ...)`):**
95+
96+
| # | Variant Attr | Enum Attr | Expected Static Method | Expected Standalone Constructor | Rule(s) | Handler (Meta) |
97+
|-----|--------------|-----------------------------|-------------------------------|---------------------------------|---------|--------------------------------|
98+
| TN.1| Default | None | `Enum::variant(T1, T2,...) -> Enum` | N/A | 3f | `tuple_multi_fields_scalar.rs` |
99+
| TN.2| `#[scalar]` | None | `Enum::variant(T1, T2,...) -> Enum` | N/A | 1f | `tuple_multi_fields_scalar.rs` |
100+
| TN.3| `#[subform_scalar]` | (Any) | *Compile Error* | *Compile Error* | 2f | (Dispatch) |
101+
| TN.4| Default | `#[standalone_constructors]`| `Enum::variant(T1, T2,...) -> Enum` | `fn variant(T1, T2,...) -> Enum` | 3f, 4 | `tuple_multi_fields_scalar.rs` |
102+
| TN.5| `#[scalar]` | `#[standalone_constructors]`| `Enum::variant(T1, T2,...) -> Enum` | `fn variant(T1, T2,...) -> Enum` | 1f, 4 | `tuple_multi_fields_scalar.rs` |
103+
104+
Note: The effect of `#[arg_for_constructor]` is covered by Rule 4 in conjunction with the base behavior.
95105

96106
### Failure Diagnosis Algorithm
97107
* (Standard algorithm as previously defined, focusing on relevant `tuple_*_handler.rs` if `_derive` fails and `_manual` passes).
98108
* **Widespread Failure Strategy:** If uncommenting a test group causes numerous failures, propose selectively commenting out (using `//`) only the failing `#[test]` functions or problematic `include!` lines. Avoid commenting out entire files or modules unless absolutely necessary. Re-enable tests incrementally (one or small groups at a time) to isolate the root cause, following Rule 9.d.i of the Proc Macro Development Workflow.
99109

100110
## Increments
101111

102-
* [] **Increment 1: Document Tuple Variant Matrix**
112+
* [] **Increment 1: Document Tuple Variant Matrix**
103113
* **Goal:** Add the Tuple Variant Test Matrix documentation to `former_enum_tests/mod.rs`, preserving existing matrices. Keep all tuple test modules commented out for now.
104114
* **Target Crate(s):** `former`
105115
* **Detailed Plan Step 1:** Modify `module/core/former/tests/inc/former_enum_tests/mod.rs`:
@@ -186,11 +196,13 @@ This plan focuses on verifying the behavior for **Tuple Variants**. The relevant
186196
* **Incremental Verification:** Verify compilation and test success after each relevant increment. Handle widespread failures by selectively commenting out only failing tests.
187197
* **Failure Analysis:** Follow the "Failure Diagnosis Algorithm".
188198
* **Approval Gates:** Obtain user approval before starting each increment and after successful verification.
199+
* **No Clippy:** Avoid using `cargo clippy`.
189200

190201
## Notes & Insights
191202
* This plan focuses on tuple enum variants, activating tests incrementally.
192203
* It assumes the necessary infrastructure (`former_enum_tests/mod.rs`) exists.
193204
* Verification steps target only the relevant tuple tests until the final step.
194205
* The full "Expected Enum Former Behavior Rules" are kept for context.
195206
* Test Matrix coverage for tuple variants is explicitly noted and will be added to `mod.rs`.
196-
* `cargo clippy` check is excluded.
207+
* `cargo clippy` check is excluded.
208+
* Increment 1 verified successfully.

module/core/former/tests/inc/former_enum_tests/mod.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,19 @@ mod unit_variant_manual;
188188
// mod standalone_constructor_args_manual; // May need adaptation
189189
//
190190
// // Increment 7: Multi-Field Tuple Variants (Default & #[scalar])
191-
// mod tuple_multi_default_derive; // May need to create
192-
// mod tuple_multi_default_manual; // May need to create
193-
// mod tuple_multi_scalar_derive; // May need to create
194-
// mod tuple_multi_scalar_manual; // May need to create
191+
// // mod tuple_multi_default_derive; // May need to create
192+
// // mod tuple_multi_default_manual; // May need to create
193+
// // mod tuple_multi_scalar_derive; // May need to create
194+
// // mod tuple_multi_scalar_manual; // May need to create
195195
//
196196
// // Increment 8: Multi-Field Tuple Variants - #[standalone_constructors]
197-
// mod tuple_multi_standalone_manual; // New for Increment 8
198-
// mod tuple_multi_standalone_derive; // New for Increment 8
199-
// mod tuple_multi_standalone_args_manual; // New for Increment 8
200-
// mod tuple_multi_standalone_args_derive; // New for Increment 8
201-
202-
// Increment 9: Error Cases for Tuple Variants
203-
// mod compile_fail; // This is a directory, needs a mod declaration
204-
205-
// mod usecase1_manual;
206-
// mod usecase1_derive;
197+
// // mod tuple_multi_standalone_manual; // New for Increment 8
198+
// // mod tuple_multi_standalone_derive; // New for Increment 8
199+
// // mod tuple_multi_standalone_args_manual; // New for Increment 8
200+
// // mod tuple_multi_standalone_args_derive; // New for Increment 8
201+
//
202+
// // Increment 9: Error Cases for Tuple Variants
203+
// // mod compile_fail; // This is a directory, needs a mod declaration
204+
//
205+
// // mod usecase1_manual;
206+
// // mod usecase1_derive;

0 commit comments

Comments
 (0)