| 881 | |
| 882 | #[test] |
| 883 | fn test_section_pair_both() { |
| 884 | let trunk_id = TrunkId::new(NodeId::new(1), 0); |
| 885 | let file_ops = FileOps::create(trunk_id, "both.rs".to_string(), Some(Encoding::Utf8)); |
| 886 | |
| 887 | let pair = SectionPair::both("both.rs".to_string(), vec![], file_ops, 0, 100); |
| 888 | |
| 889 | assert!(pair.has_graph()); |
| 890 | assert!(pair.has_semantic()); |
| 891 | assert!(pair.has_both()); |
| 892 | assert_eq!(pair.path(), "both.rs"); |
| 893 | |
| 894 | let graph = pair.graph.as_ref().unwrap(); |
| 895 | assert_eq!(graph.path(), "both.rs"); |
| 896 | assert_eq!(graph.content_range(), 0..100); |
| 897 | |
| 898 | let semantic = pair.semantic.as_ref().unwrap(); |
| 899 | assert_eq!(semantic.path(), "both.rs"); |
| 900 | assert_eq!(semantic.content_range(), 0..100); |
| 901 | } |
| 902 | |
| 903 | #[test] |
| 904 | fn test_section_pair_graph_only() { |