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

Function test_word_diff_replacement

atomic-core/src/diff/word.rs:1053–1063  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1051
1052 #[test]
1053 fn test_word_diff_replacement() {
1054 let result = word_diff(b"const x = 1;", b"const x = 2;");
1055 assert!(result.has_changes());
1056
1057 // The number 1 should be replaced with 2
1058 let has_replace_or_del_ins = result
1059 .ops()
1060 .iter()
1061 .any(|op| op.is_replace() || op.is_delete() || op.is_insert());
1062 assert!(has_replace_or_del_ins);
1063 }
1064
1065 #[test]
1066 fn test_word_diff_edit_distance() {

Callers

nothing calls this directly

Calls 6

word_diffFunction · 0.85
iterMethod · 0.45
opsMethod · 0.45
is_replaceMethod · 0.45
is_deleteMethod · 0.45
is_insertMethod · 0.45

Tested by

no test coverage detected