MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / test_update_part

Function test_update_part

crates/opencode-session/src/session.rs:1336–1356  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1334
1335 #[test]
1336 fn test_update_part() {
1337 let mut session = Session::new("project-1", "/path");
1338 let msg = session.add_user_message("Hello");
1339 let msg_id = msg.id.clone();
1340 let part_id = msg.parts[0].id.clone();
1341
1342 // Update existing part
1343 let replacement = MessagePart {
1344 id: part_id.clone(),
1345 part_type: crate::PartType::Text {
1346 text: "Updated".into(),
1347 synthetic: None,
1348 ignored: None,
1349 },
1350 created_at: Utc::now(),
1351 message_id: None,
1352 };
1353 let result = session.update_part(&msg_id, replacement);
1354 assert!(result.is_some());
1355 assert_eq!(result.unwrap().id, part_id);
1356 }
1357
1358 #[test]
1359 fn test_remove_part() {

Callers

nothing calls this directly

Calls 4

newFunction · 0.85
add_user_messageMethod · 0.45
cloneMethod · 0.45
update_partMethod · 0.45

Tested by

no test coverage detected