()
| 528 | |
| 529 | #[test] |
| 530 | fn test_apply_create() { |
| 531 | let mut txn = MockTxn::new(); |
| 532 | let mut context = ApplyContext::new(ApplyOptions::default()); |
| 533 | let trunk_id = TrunkId::new(NodeId::new(1), 0); |
| 534 | |
| 535 | let op = TrunkOp::Create { |
| 536 | path: "test.rs".to_string(), |
| 537 | encoding: Some(Encoding::Utf8), |
| 538 | }; |
| 539 | |
| 540 | apply_trunk_op(&mut txn, &mut context, trunk_id, &op).unwrap(); |
| 541 | |
| 542 | assert!(txn.has_trunk(trunk_id).unwrap()); |
| 543 | let trunk = txn.get_trunk(trunk_id).unwrap().unwrap(); |
| 544 | assert_eq!(trunk.path(), "test.rs"); |
| 545 | assert_eq!(trunk.encoding(), Some(Encoding::Utf8)); |
| 546 | assert_eq!(context.stats().trunks_created(), 1); |
| 547 | } |
| 548 | |
| 549 | #[test] |
| 550 | fn test_apply_create_duplicate_id() { |
nothing calls this directly
no test coverage detected