diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-21 05:49:00 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-21 05:49:00 +0800 |
| commit | 700c049f64b66f424cda5da3021dfce4462655ca (patch) | |
| tree | b4fd21e5e6f82be29b18c47d8617814b28c159a6 /mingling_core/tests/test-all | |
| parent | 2097238b57810d78989d3ecab8bc97ce1b8a6aa1 (diff) | |
feat(core): add generic parameter `C` to `StructuralData` trait
Make `StructuralData` and `StructuralDataSealed` generic over a program
collector type to bypass the orphan rule for `group_structural!`. This
enables external types to implement `StructuralData<crate::ThisProgram>`
without violating coherence.
Diffstat (limited to 'mingling_core/tests/test-all')
| -rw-r--r-- | mingling_core/tests/test-all/tests/integration.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mingling_core/tests/test-all/tests/integration.rs b/mingling_core/tests/test-all/tests/integration.rs index 08703b0..d36b9df 100644 --- a/mingling_core/tests/test-all/tests/integration.rs +++ b/mingling_core/tests/test-all/tests/integration.rs @@ -1,5 +1,4 @@ use mingling::Flag; -use mingling::MockProgramCollect; use mingling::NextProcess; use mingling::Node; use mingling::Program; @@ -125,13 +124,13 @@ fn test_structural_renderer_json() { #[test] fn test_is_completing() { - let program: Program<MockProgramCollect> = Program::new_with_args(["app", "__comp"]); + let program: Program<crate::ThisProgram> = Program::new_with_args(["app", "__comp"]); assert!(program.is_completing()); } #[test] fn test_is_not_completing() { - let program: Program<MockProgramCollect> = Program::new_with_args(["app", "greet"]); + let program: Program<crate::ThisProgram> = Program::new_with_args(["app", "greet"]); assert!(!program.is_completing()); } @@ -141,7 +140,7 @@ fn test_is_not_completing() { fn test_hook_setup() { static CALLED: AtomicBool = AtomicBool::new(false); - let hook = ProgramHook::<MockProgramCollect>::empty().on_begin::<_, ()>(|_| { + let hook = ProgramHook::<crate::ThisProgram>::empty().on_begin::<_, ()>(|_| { CALLED.store(true, Ordering::SeqCst); }); @@ -166,3 +165,5 @@ fn test_string_vec_from_array() { let v: Vec<String> = sv.into(); assert_eq!(v, vec!["a", "b", "c"]); } + +mingling::macros::gen_program!(); |
