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

Source from the content-addressed store, hash-verified

1599
1600 #[test]
1601 fn test_line_ops_content_range() {
1602 use crate::types::ChangePosition;
1603
1604 let mut ops = LineOps::insert(test_branch_id(0), None, vec![]);
1605
1606 // Initially no content range
1607 assert!(!ops.has_content_range());
1608 assert!(ops.content_range().is_none());
1609
1610 // Set content range
1611 let start = ChangePosition::new(100);
1612 let end = ChangePosition::new(150);
1613 ops.set_content_range(start, end);
1614
1615 // Now has content range
1616 assert!(ops.has_content_range());
1617 let range = ops.content_range().unwrap();
1618 assert_eq!(range.0.get(), 100);
1619 assert_eq!(range.1.get(), 150);
1620 }
1621
1622 #[test]
1623 fn test_line_ops_with_content_range_builder() {

Callers

nothing calls this directly

Calls 5

test_branch_idFunction · 0.85
insertFunction · 0.50
set_content_rangeMethod · 0.45
unwrapMethod · 0.45
content_rangeMethod · 0.45

Tested by

no test coverage detected