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:1381–1400  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1379
1380 #[test]
1381 fn test_line_ops_content_range() {
1382 use crate::types::ChangePosition;
1383
1384 let mut ops = LineOps::insert(test_branch_id(0), None, vec![]);
1385
1386 // Initially no content range
1387 assert!(!ops.has_content_range());
1388 assert!(ops.content_range().is_none());
1389
1390 // Set content range
1391 let start = ChangePosition::new(100);
1392 let end = ChangePosition::new(150);
1393 ops.set_content_range(start, end);
1394
1395 // Now has content range
1396 assert!(ops.has_content_range());
1397 let range = ops.content_range().unwrap();
1398 assert_eq!(range.0.get(), 100);
1399 assert_eq!(range.1.get(), 150);
1400 }
1401
1402 #[test]
1403 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