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

Function test_stats_populated

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

Source from the content-addressed store, hash-verified

860
861 #[test]
862 fn test_stats_populated() {
863 let mut builder = RecordBuilder::new();
864
865 builder.append_contents(b"test content here");
866 builder.add_hunk(create_test_file_add_hunk());
867 builder.add_hunk(create_test_file_add_hunk());
868 builder.add_inode_update(0, InodeUpdate::add(ChangePosition::new(0), Inode::new(1)));
869 builder.mark_inode_recorded(Inode::new(1), Position::ROOT.to_option());
870 builder.mark_binary_file();
871 builder.update_largest_file(500);
872
873 let stats = builder.stats();
874
875 assert!(!stats.is_empty());
876 assert_eq!(stats.hunk_count, 2);
877 assert_eq!(stats.content_bytes, 17);
878 assert_eq!(stats.inode_update_count, 1);
879 assert_eq!(stats.recorded_inode_count, 1);
880 assert_eq!(stats.largest_file, 500);
881 assert!(stats.has_binary_files);
882 }
883
884 // Recorded Tests
885

Callers

nothing calls this directly

Calls 9

add_inode_updateMethod · 0.80
mark_inode_recordedMethod · 0.80
mark_binary_fileMethod · 0.80
update_largest_fileMethod · 0.80
append_contentsMethod · 0.45
add_hunkMethod · 0.45
to_optionMethod · 0.45
statsMethod · 0.45

Tested by

no test coverage detected