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

Function test_multiline_conversion

atomic-core/src/diff/semantic_to_crdt.rs:837–851  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

835
836 #[test]
837 fn test_multiline_conversion() {
838 let old = b"fn main() {\n println!(\"Hello\");\n}\n";
839 let new = b"fn main() {\n println!(\"Hello, World!\");\n return;\n}\n";
840
841 let diff = semantic_diff(old, new);
842 assert!(diff.has_changes());
843
844 let mut converter = SemanticToCrdt::with_defaults(test_change_id(), test_trunk_id());
845 let _file_ops = converter.convert_diff(&diff, "main.rs").unwrap();
846
847 let stats = converter.stats();
848 assert!(stats.has_operations());
849 // Should have modifications and/or additions
850 assert!(stats.lines_inserted > 0 || stats.tokens_inserted > 0);
851 }
852}

Callers

nothing calls this directly

Calls 6

semantic_diffFunction · 0.85
test_change_idFunction · 0.85
convert_diffMethod · 0.80
test_trunk_idFunction · 0.70
unwrapMethod · 0.45
statsMethod · 0.45

Tested by

no test coverage detected