()
| 809 | |
| 810 | #[test] |
| 811 | fn test_output_single_vertex() { |
| 812 | let content = b"Hello, world!"; |
| 813 | let node = make_vertex(1, 0, content.len() as u64); |
| 814 | let graph = make_simple_graph(node); |
| 815 | let order = make_simple_order(); |
| 816 | |
| 817 | let changes = MemoryChangeStore::new(); |
| 818 | let change = make_change(content); |
| 819 | let hash = change.hash().unwrap(); |
| 820 | changes.insert(hash, change); |
| 821 | |
| 822 | let hash_fn = |id: NodeId| { |
| 823 | if id.get() == 1 { |
| 824 | Some(hash) |
| 825 | } else { |
| 826 | None |
| 827 | } |
| 828 | }; |
| 829 | |
| 830 | let mut buffer = Vec::new(); |
| 831 | { |
| 832 | let pos = Position::ROOT; |
| 833 | let mut writer = ConflictWriter::new(&mut buffer, "test.rs", pos); |
| 834 | |
| 835 | let result = output_graph_content(&changes, hash_fn, &graph, &order, &mut writer); |
| 836 | assert!(result.is_ok()); |
| 837 | } |
| 838 | assert_eq!(&buffer, content); |
| 839 | } |
| 840 | |
| 841 | #[test] |
| 842 | fn test_output_empty_vertex_skipped() { |
nothing calls this directly
no test coverage detected