Summary
The cleanup_test_files function is duplicated across multiple test files in the file I/O test suite.
Affected Files
The same helper function appears in:
tests/file_io_execution_test.rs (lines 12-16)
tests/file_io_error_handling_test.rs (lines 12-16)
tests/file_io_performance_test.rs (lines 14-18)
tests/file_io_concurrent_test.rs (lines 13-17)
Proposed Solution
Extract the function to a shared test utilities module:
- Create
tests/common.rs with a public cleanup_test_files(files: &[&str]) function
- Remove the local function from each test file
- Add module import (e.g.,
mod common; or #[path = "common.rs"] mod common;) to each test file
- Update calls to use
common::cleanup_test_files(...)
Benefits
- Reduces code duplication
- Centralizes test utility functions
- Makes maintenance easier
Backlinks
Requested by: @logbie
Summary
The
cleanup_test_filesfunction is duplicated across multiple test files in the file I/O test suite.Affected Files
The same helper function appears in:
tests/file_io_execution_test.rs(lines 12-16)tests/file_io_error_handling_test.rs(lines 12-16)tests/file_io_performance_test.rs(lines 14-18)tests/file_io_concurrent_test.rs(lines 13-17)Proposed Solution
Extract the function to a shared test utilities module:
tests/common.rswith a publiccleanup_test_files(files: &[&str])functionmod common;or#[path = "common.rs"] mod common;) to each test filecommon::cleanup_test_files(...)Benefits
Backlinks
Requested by: @logbie