|
1 | 1 | //! Ensure max_log_files limits the total number of log files across multiple date patterns. |
2 | 2 |
|
3 | | -use logforth_append_file::FileBuilder; |
4 | | -use logforth_core::Append; |
5 | | -use logforth_core::record::Record; |
6 | 3 | use std::fs; |
7 | 4 | use std::num::NonZeroUsize; |
8 | 5 | use std::path::Path; |
9 | 6 | use std::thread; |
10 | 7 | use std::time::Duration; |
| 8 | + |
| 9 | +use logforth_append_file::FileBuilder; |
| 10 | +use logforth_core::Append; |
| 11 | +use logforth_core::record::Record; |
11 | 12 | use tempfile::TempDir; |
12 | 13 |
|
13 | 14 | #[test] |
@@ -77,7 +78,8 @@ fn test_file_limit_across_multiple_dates() { |
77 | 78 | let max_files = 10; // Set maximum file count to 10 |
78 | 79 | let max_size = 50; // Small file size to trigger rotation quickly |
79 | 80 |
|
80 | | - // Create multiple log writers, each with a different filename pattern (simulating different dates) |
| 81 | + // Create multiple log writers, each with a different filename pattern (simulating different |
| 82 | + // dates) |
81 | 83 | println!("Creating multiple log files with different date patterns"); |
82 | 84 |
|
83 | 85 | // First batch - simulate March 18 |
@@ -114,7 +116,8 @@ fn test_file_limit_across_multiple_dates() { |
114 | 116 | println!("Files: {:?}", files); |
115 | 117 |
|
116 | 118 | // Verify if the total number of files exceeds the limit |
117 | | - // Note: If this assertion fails, it means we've reproduced the issue - file count is not properly limited |
| 119 | + // Note: If this assertion fails, it means we've reproduced the issue - file count is not |
| 120 | + // properly limited |
118 | 121 | assert!( |
119 | 122 | files.len() <= max_files, |
120 | 123 | "Expected at most {} files, but found {} files across multiple dates", |
|
0 commit comments