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

Function test_semantic_diff_multiline

atomic-core/src/diff/semantic/tests.rs:382–392  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

380
381 #[test]
382 fn test_semantic_diff_multiline() {
383 let old = b"fn main() {\n let x = 1;\n println!(x);\n}\n";
384 let new = b"fn main() {\n let x = 42;\n let y = 2;\n println!(x);\n}\n";
385
386 let diff = semantic_diff(old, new);
387 assert!(diff.has_changes());
388
389 // Line 2 modified (1 -> 42), line 3 added (let y = 2)
390 assert!(diff.stats().lines_modified >= 1);
391 assert!(diff.stats().lines_added >= 1);
392 }
393
394 #[test]
395 fn test_semantic_diff_all_token_changes() {

Callers

nothing calls this directly

Calls 1

semantic_diffFunction · 0.85

Tested by

no test coverage detected