()
| 842 | |
| 843 | #[test] |
| 844 | fn test_output_single_vertex() { |
| 845 | let content = b"Hello, world!"; |
| 846 | let node = make_vertex(1, 0, content.len() as u64); |
| 847 | let graph = make_simple_graph(node); |
| 848 | let order = make_simple_order(); |
| 849 | |
| 850 | let changes = MemoryChangeStore::new(); |
| 851 | let change = make_change(content); |
| 852 | let hash = change.hash().unwrap(); |
| 853 | changes.insert(hash, change); |
| 854 | |
| 855 | let hash_fn = |id: NodeId| { |
| 856 | if id.get() == 1 { |
| 857 | Some(hash) |
| 858 | } else { |
| 859 | None |
| 860 | } |
| 861 | }; |
| 862 | |
| 863 | let mut buffer = Vec::new(); |
| 864 | { |
| 865 | let pos = Position::ROOT; |
| 866 | let mut writer = ConflictWriter::new(&mut buffer, "test.rs", pos); |
| 867 | |
| 868 | let result = output_graph_content(&changes, hash_fn, &graph, &order, &mut writer); |
| 869 | assert!(result.is_ok()); |
| 870 | } |
| 871 | assert_eq!(&buffer, content); |
| 872 | } |
| 873 | |
| 874 | #[test] |
| 875 | fn test_output_empty_vertex_skipped() { |
nothing calls this directly
no test coverage detected