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