MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_session_record_roundtrip

Function test_session_record_roundtrip

atomic-core/src/change/session.rs:1412–1439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1410
1411 #[test]
1412 fn test_session_record_roundtrip() {
1413 let record = SessionRecord {
1414 session_id: "sess-1".into(),
1415 json_path: ".atomic/sessions/sess-1.json".into(),
1416 view_name: Some("agent-sess-1".into()),
1417 parent_view: Some("main".into()),
1418 first_provenance: Some(Hash::of(b"p0")),
1419 latest_provenance: Some(Hash::of(b"p1")),
1420 turn_count: 2,
1421 started_at: 100,
1422 ended_at: None,
1423 status: SessionStatus::Incomplete(IncompleteSession::new(
1424 "working copy moved during managed turn",
1425 vec!["src/z.rs".into(), "src/a.rs".into(), "src/a.rs".into()],
1426 "refs/atomic/wip/run-1",
1427 SessionIncompleteOrigin::UnknownPostCheckout,
1428 )),
1429 };
1430
1431 assert_eq!(
1432 SessionRecord::from_bytes(&record.to_bytes()).unwrap(),
1433 record
1434 );
1435 assert_eq!(
1436 record.status.incomplete().unwrap().paths,
1437 vec!["src/a.rs", "src/z.rs"]
1438 );
1439 }
1440
1441 #[test]
1442 fn test_session_record_reads_pre_status_encoding() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected