| 1638 | |
| 1639 | #[test] |
| 1640 | fn test_turn_boundary_roundtrip() { |
| 1641 | let boundary = TurnBoundary { |
| 1642 | working_copy: "01ABCDEF26CHARSULID0000000".into(), |
| 1643 | operation: None, |
| 1644 | view: "main".into(), |
| 1645 | view_state: Some(Hash::of(b"merkle")), |
| 1646 | set_id: Some(crate::types::SetId::ZERO), |
| 1647 | snapshot: None, |
| 1648 | git: Some(GitBoundaryCheckpoint { |
| 1649 | head_oid: Some("0123456789abcdef0123456789abcdef01234567".into()), |
| 1650 | head_symref: Some("refs/heads/main".into()), |
| 1651 | head_tree: Some("tree1".into()), |
| 1652 | index_digest: Some(Hash::of(b"index")), |
| 1653 | index_tree: Some("tree2".into()), |
| 1654 | index_locked: false, |
| 1655 | repository_state: "".into(), |
| 1656 | markers: vec![], |
| 1657 | }), |
| 1658 | manifest: None, |
| 1659 | conversion_policy: None, |
| 1660 | session_id: "sess-b".into(), |
| 1661 | turn: 3, |
| 1662 | at: 42, |
| 1663 | }; |
| 1664 | let bytes = postcard::to_allocvec(&boundary).unwrap(); |
| 1665 | let loaded: TurnBoundary = postcard::from_bytes(&bytes).unwrap(); |
| 1666 | assert_eq!(loaded, boundary); |
| 1667 | // Phase 4 fields stay None — they are never faked. |
| 1668 | assert!(loaded.manifest.is_none()); |
| 1669 | assert!(loaded.conversion_policy.is_none()); |
| 1670 | } |
| 1671 | |
| 1672 | #[test] |
| 1673 | fn test_managed_turn_outcome_roundtrip() { |