Skip to content

Commit 5c65430

Browse files
Shane Wallclaude
andcommitted
fix: resolve test compilation errors and warnings
Fixed issues after initial warning cleanup: - Added HashMap import to transform.rs test module - Added LogLevel import to logging.rs test module - Removed unused imports from test files: * integration_tests.rs: CopyMode, is_zero_copy_available, Write * error_handling_integration_tests.rs: LogLevel, TempDir * filter_integration_test.rs: PathBuf * delta_integration_test.rs: Write - Removed unused imports from source files: * logging.rs: PathBuf in test module * filter.rs: PathBuf in test module * telemetry.rs: ProgressPublisher in test module - Added #[allow(unused_variables)] to platform-specific functions in file_metadata.rs - Added unicode-normalization feature to Cargo.toml to fix cfg warnings All tests now compile without errors or warnings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 13cd3e4 commit 5c65430

11 files changed

Lines changed: 15 additions & 10 deletions

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ tempfile = "3.10"
5353
glob = "0.3"
5454
regex = "1.10"
5555

56+
# Unicode normalization for path handling (optional)
57+
unicode-normalization = { version = "0.1", optional = true }
58+
5659
# Date/time
5760
chrono = { version = "0.4", features = ["serde"] }
5861

@@ -174,5 +177,8 @@ delta-manifest = ["dep:rusqlite"]
174177
# Extended attributes and metadata preservation
175178
extended-metadata = ["dep:xattr"]
176179

180+
# Unicode normalization for consistent path encoding
181+
unicode-normalization = ["dep:unicode-normalization"]
182+
177183
# Full feature set
178184
full = ["zero-copy", "protocols", "smb-native", "s3-native", "ssh-backend", "backend-abstraction", "delta-manifest", "extended-metadata"]

src/core/file_metadata.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ impl FileMetadata {
274274
}
275275

276276
/// Apply permissions to destination
277+
#[allow(unused_variables)]
277278
fn apply_permissions(&self, dest_path: &Path) -> Result<()> {
278279
#[cfg(unix)]
279280
if let Some(mode) = self.permissions {
@@ -293,6 +294,7 @@ impl FileMetadata {
293294
}
294295

295296
/// Apply ownership to destination (Unix only, requires privileges)
297+
#[allow(unused_variables)]
296298
fn apply_ownership(&self, dest_path: &Path) -> Result<()> {
297299
#[cfg(unix)]
298300
{

src/core/filter.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,6 @@ fn add_pattern_to_filter(
473473
#[cfg(test)]
474474
mod tests {
475475
use super::*;
476-
use std::path::PathBuf;
477476

478477
#[test]
479478
fn test_glob_matching() {

src/core/transform.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ impl Default for TransformBuilder {
348348
#[cfg(test)]
349349
mod tests {
350350
use super::*;
351+
use std::collections::HashMap;
351352

352353
#[test]
353354
fn test_path_transform_basename() {

src/logging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn init_test_logging() {
104104
#[cfg(test)]
105105
mod tests {
106106
use super::*;
107-
use std::path::PathBuf;
107+
use crate::config::LogLevel;
108108
use tempfile::NamedTempFile;
109109

110110
#[test]

src/telemetry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl TelemetryLogger {
276276
#[cfg(test)]
277277
mod tests {
278278
use super::*;
279-
use crate::core::progress::{ProgressPublisher, FileId};
279+
use crate::core::progress::FileId;
280280
use std::path::PathBuf;
281281

282282
#[test]

tests/delta_integration_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use orbit::{copy_file, config::CopyConfig, core::delta::CheckMode};
66
use std::fs;
7-
use std::io::Write;
87
use tempfile::tempdir;
98

109
#[test]

tests/error_handling_integration_tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@
1010
*/
1111

1212
use orbit::{
13-
config::{CopyConfig, ErrorMode, LogLevel},
13+
config::{CopyConfig, ErrorMode},
1414
error::{OrbitError, ErrorCategory},
1515
instrumentation::OperationStats,
1616
core::CopyStats,
1717
};
1818
use std::sync::atomic::{AtomicU32, Ordering};
1919
use std::sync::Arc;
2020
use std::time::{Duration, Instant};
21-
use tempfile::TempDir;
2221

2322
/// Simulated flaky operation that fails N times before succeeding
2423
struct FlakyOperation {

tests/filter_integration_test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use orbit::{copy_directory, CopyConfig, CopyMode};
66
use std::fs;
7-
use std::path::PathBuf;
87
use tempfile::TempDir;
98

109
#[test]

0 commit comments

Comments
 (0)