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

Function test_operations_have_correct_positions

atomic-core/src/diff/myers.rs:343–356  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

341
342 #[test]
343 fn test_operations_have_correct_positions() {
344 let old = lines(&["a\n", "b\n", "c\n"]);
345 let new = lines(&["a\n", "x\n", "c\n"]);
346
347 let result = diff(&old, &new);
348
349 // Find the change operation
350 let changes: Vec<_> = result.changes().collect();
351 assert_eq!(changes.len(), 1);
352
353 // The change should be at position 1 (second line)
354 let change = changes[0];
355 assert_eq!(change.old_range().start, 1);
356 }
357
358 #[test]
359 fn test_edit_distance() {

Callers

nothing calls this directly

Calls 3

linesFunction · 0.70
diffFunction · 0.70
changesMethod · 0.45

Tested by

no test coverage detected