()
| 714 | } |
| 715 | |
| 716 | fn fixture() -> (tempfile::TempDir, Repository, Hash, Hash) { |
| 717 | let dir = tempfile::tempdir().unwrap(); |
| 718 | let mut repo = Repository::init(dir.path()).unwrap(); |
| 719 | repo.create_draft_view("source", "dev").unwrap(); |
| 720 | repo.create_draft_view("target", "dev").unwrap(); |
| 721 | let normal = Change::new(ChangeHeader::new("ordinary"), vec![], vec![], vec![]); |
| 722 | let normal = repo.save_change(&normal).unwrap(); |
| 723 | { |
| 724 | let mut txn = repo.pristine().write_txn().unwrap(); |
| 725 | txn.put_required_capability(SPAN_RANGE_CAPABILITY).unwrap(); |
| 726 | txn.commit().unwrap(); |
| 727 | } |
| 728 | let mut change = Change::new(ChangeHeader::new("span"), vec![], b"x\n".to_vec(), vec![]); |
| 729 | change.hashed.span = Some(SpanPatch::new( |
| 730 | vec![], |
| 731 | vec![SpanOp::Root { |
| 732 | path: "x".into(), |
| 733 | ordinal: 0, |
| 734 | start: 0, |
| 735 | end: 2, |
| 736 | }], |
| 737 | )); |
| 738 | let span = repo.save_change(&change).unwrap(); |
| 739 | (dir, repo, normal, span) |
| 740 | } |
| 741 | |
| 742 | #[test] |
| 743 | fn direct_insert_does_not_publish_span_without_namespace_creation() { |
no test coverage detected