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

Function test_patience_vs_myers_structural

atomic-core/src/diff/patience.rs:601–617  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

599 // Integration Tests
600 #[test]
601 fn test_patience_vs_myers_structural() {
602 // A case where patience should produce better results
603 let old = lines(&["void foo() {\n", "}\n", "void bar() {\n", "}\n"]);
604 let new = lines(&[
605 "void foo() {\n",
606 " int x;\n",
607 "}\n",
608 "void bar() {\n",
609 "}\n",
610 ]);
611
612 let result = diff(&old, &new);
613
614 // Should detect insertion of "int x;" inside foo
615 assert_eq!(result.insertions(), 1);
616 assert_eq!(result.deletions(), 0);
617 }
618
619 #[test]
620 fn test_fallback_to_myers() {

Callers

nothing calls this directly

Calls 2

linesFunction · 0.70
diffFunction · 0.70

Tested by

no test coverage detected