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

Function test_line_ops_content_range

atomic-core/src/change/ops.rs:1045–1064  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1043
1044 #[test]
1045 fn test_line_ops_content_range() {
1046 use crate::types::ChangePosition;
1047
1048 let mut ops = LineOps::insert(test_branch_id(0), None, vec![]);
1049
1050 // Initially no content range
1051 assert!(!ops.has_content_range());
1052 assert!(ops.content_range().is_none());
1053
1054 // Set content range
1055 let start = ChangePosition::new(100);
1056 let end = ChangePosition::new(150);
1057 ops.set_content_range(start, end);
1058
1059 // Now has content range
1060 assert!(ops.has_content_range());
1061 let range = ops.content_range().unwrap();
1062 assert_eq!(range.0.get(), 100);
1063 assert_eq!(range.1.get(), 150);
1064 }
1065
1066 #[test]
1067 fn test_line_ops_with_content_range_builder() {

Callers

nothing calls this directly

Calls 4

test_branch_idFunction · 0.85
set_content_rangeMethod · 0.45
unwrapMethod · 0.45
content_rangeMethod · 0.45

Tested by

no test coverage detected