Skip to content

Commit 48e92cd

Browse files
committed
former
1 parent 0d423e5 commit 48e92cd

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

module/core/former/tests/inc/enum_unnamed_tests/generics_independent_tuple_manual.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ use super::*; // Imports testing infrastructure and potentially other common ite
1616
use std::marker::PhantomData;
1717
use former_types::
1818
{
19-
Assign,
2019
FormingEnd, StoragePreform, FormerDefinition, FormerDefinitionTypes, Storage,
2120
ReturnPreformed, FormerBegin, FormerMutator,
2221
};
22+
// use component_model_types::Assign; // Not available in test context
2323

2424
// --- Dummy Bounds ---
2525
// Defined in _only_test.rs

module/core/former/tests/inc/enum_unnamed_tests/generics_independent_tuple_only_test.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
//! Purpose: Provides shared test assertions and logic for verifying the constructors generated
2-
//! by `#[derive(Former)]` for enums with unnamed (tuple) variants that have independent generic
3-
//! parameters and bounds, specifically when the variant is marked with `#[scalar]`.
4-
//! This file is included by both `generics_independent_tuple_derive.rs` and `generics_independent_tuple_manual.rs`.
5-
//!
6-
//! Coverage:
7-
//! - Rule 1d (Tuple + Single-Field + `#[scalar]` -> Scalar): Tests static method `EnumG5::<T>::v_1()`.
8-
//! - Rule 4b (Option 2 Logic): Tests the use of subformer methods and `.form()`.
9-
//!
10-
//! Test Relevance/Acceptance Criteria:
11-
//! - Defines dummy bounds (`BoundA`, `BoundB`) and concrete types (`TypeForT`, `TypeForU`) that satisfy them.
12-
//! - Defines test functions (`independent_generics_tuple_variant`, `default_construction_independent_generics`)
13-
//! that invoke the static method `EnumG5::<TypeForT>::v_1()` provided by the including file (either derived or manual).
14-
//! - This constructor returns a subformer (`InnerG5Former` specialized with `TypeForU` and configured to return `EnumG5<TypeForT>`).
15-
//! - The tests use the subformer setter (`._0()`) and `.form()` to build the final enum instance.
16-
//! - Asserts that the resulting `EnumG5` enum instances are equal to the expected variants
17-
//! (`EnumG5::V1(InnerG5 { ... }, PhantomData)`), confirming correct handling of independent generics and the `#[scalar]` attribute.
1+
// Purpose: Provides shared test assertions and logic for verifying the constructors generated
2+
// by `#[derive(Former)]` for enums with unnamed (tuple) variants that have independent generic
3+
// parameters and bounds, specifically when the variant is marked with `#[scalar]`.
4+
// This file is included by both `generics_independent_tuple_derive.rs` and `generics_independent_tuple_manual.rs`.
5+
//
6+
// Coverage:
7+
// - Rule 1d (Tuple + Single-Field + `#[scalar]` -> Scalar): Tests static method `EnumG5::<T>::v_1()`.
8+
// - Rule 4b (Option 2 Logic): Tests the use of subformer methods and `.form()`.
9+
//
10+
// Test Relevance/Acceptance Criteria:
11+
// - Defines dummy bounds (`BoundA`, `BoundB`) and concrete types (`TypeForT`, `TypeForU`) that satisfy them.
12+
// - Defines test functions (`independent_generics_tuple_variant`, `default_construction_independent_generics`)
13+
// that invoke the static method `EnumG5::<TypeForT>::v_1()` provided by the including file (either derived or manual).
14+
// - This constructor returns a subformer (`InnerG5Former` specialized with `TypeForU` and configured to return `EnumG5<TypeForT>`).
15+
// - The tests use the subformer setter (`._0()`) and `.form()` to build the final enum instance.
16+
// - Asserts that the resulting `EnumG5` enum instances are equal to the expected variants
17+
// (`EnumG5::V1(InnerG5 { ... }, PhantomData)`), confirming correct handling of independent generics and the `#[scalar]` attribute.
1818
use super::*; // Imports items from the parent file (either manual or derive)
1919
// Define dummy bounds for testing purposes
2020
pub trait BoundA : core::fmt::Debug + Default + Clone + PartialEq {}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ mod basic_manual; // Re-enabled - fixed missing Former types by enabling derive
5151
// mod basic_only_test; // Test file is included by basic_manual.rs, not a standalone module
5252
// mod generics_in_tuple_variant_only_test; // Disabled - type resolution issues
5353
// mod generics_independent_tuple_derive; // Disabled - complex generic syntax errors need fixing
54-
// mod generics_independent_tuple_manual; // Disabled - missing imports
55-
// mod generics_independent_tuple_only_test; // Disabled - type resolution issues
54+
mod generics_independent_tuple_manual; // Re-enabled - testing manual implementation
55+
// mod generics_independent_tuple_only_test; // Disabled - conflicts with manual file types (included test)
5656
// mod generics_shared_tuple_derive; // Disabled - enum Former delegation not fully implemented
5757

58-
// mod generics_shared_tuple_manual; // Disabled - complex issues
58+
mod generics_shared_tuple_manual; // Re-enabled - testing manual implementation with shared generics
5959
// mod generics_shared_tuple_only_test;
6060
mod test_syntax; // Re-enabled - just syntax test without Former derive
6161
// mod scalar_generic_tuple_derive; // Disabled - requires manual version

0 commit comments

Comments
 (0)