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

Function test_clear

atomic-core/src/record/builder.rs:829–847  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

827
828 #[test]
829 fn test_clear() {
830 let mut builder = RecordBuilder::new();
831
832 builder.append_contents(b"test");
833 builder.add_hunk(create_test_file_add_hunk());
834 builder.mark_inode_recorded(Inode::new(1), Position::ROOT.to_option());
835 builder.mark_binary_file();
836 builder.update_largest_file(1000);
837
838 assert!(!builder.is_empty());
839
840 builder.clear();
841
842 assert!(builder.is_empty());
843 assert_eq!(builder.contents_len(), 0);
844 assert_eq!(builder.largest_file(), 0);
845 assert!(!builder.has_binary_files());
846 assert!(!builder.is_inode_recorded(&Inode::new(1)));
847 }
848
849 // Stats Tests
850

Callers

nothing calls this directly

Calls 8

mark_inode_recordedMethod · 0.80
mark_binary_fileMethod · 0.80
update_largest_fileMethod · 0.80
clearMethod · 0.65
append_contentsMethod · 0.45
add_hunkMethod · 0.45
to_optionMethod · 0.45

Tested by

no test coverage detected