MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_section_pair_both

Function test_section_pair_both

atomic-core/src/change/format_v3/sections.rs:883–901  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 3

as_refMethod · 0.80
createFunction · 0.50
unwrapMethod · 0.45

Tested by

no test coverage detected