Testing: file.c has only 21% coverage — many critical functions untested #132
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
src/shared/file.cis one of the most critical files (373 lines) but only 21% covered. Key untested functions:old_data_from_path()receive_delta_file()receive_incremental_check()file_send_sendfile()file_receive()receive_manifest()to_disk()file_save_to_disk()These are the core I/O functions for the sync operation. Bugs here cause data corruption.
Suggested tests
old_data_from_path()— test with existing file, missing file, empty file, large filereceive_delta_file()— test with valid delta, empty delta, corner case deltasreceive_incremental_check()— test with matching file, different mtime, different size, missing targetfile_send_sendfile()— test with regular file, pipe, zero-length filefile_receive()— full receive cycle with various file typesreceive_manifest()— test manifest processing for deleteto_disk()— test directory creation, partial paths, edge casesfile_save_to_disk()— test overwrite, temp file, path traversal blockingLabels: testing, coverage, data-integrity