chore: update dependencies and remove unused test modules

This commit is contained in:
Andrew Phillips
2025-08-14 12:23:46 -03:00
committed by Andrew Phillips (aider)
parent 0abb76e785
commit 24d7c4742c
9 changed files with 601 additions and 601 deletions

View File

@@ -1,30 +0,0 @@
#[cfg(test)]
mod tests {
use keep::compression_engine::CompressionType;
use std::str::FromStr;
#[test]
fn test_compression_type_display() {
assert_eq!(format!("{}", CompressionType::LZ4), "LZ4");
assert_eq!(format!("{}", CompressionType::GZip), "GZip");
assert_eq!(format!("{}", CompressionType::None), "None");
}
#[test]
fn test_compression_type_from_str() {
assert_eq!(CompressionType::from_str("lz4").unwrap(), CompressionType::LZ4);
assert_eq!(CompressionType::from_str("gzip").unwrap(), CompressionType::GZip);
assert_eq!(CompressionType::from_str("none").unwrap(), CompressionType::None);
// Test case insensitivity
assert_eq!(CompressionType::from_str("LZ4").unwrap(), CompressionType::LZ4);
assert_eq!(CompressionType::from_str("GZIP").unwrap(), CompressionType::GZip);
assert_eq!(CompressionType::from_str("NONE").unwrap(), CompressionType::None);
}
#[test]
fn test_compression_type_from_str_invalid() {
assert!(CompressionType::from_str("invalid").is_err());
assert!(CompressionType::from_str("").is_err());
assert!(CompressionType::from_str("xz").is_err());
}
}

View File

@@ -1,39 +0,0 @@
#[cfg(test)]
mod tests {
use keep::compression_engine::{self, CompressionType};
#[test]
fn test_compression_engine_factory() {
// Test getting different compression engines
let lz4_engine = compression_engine::get_compression_engine(
CompressionType::LZ4
).expect("Failed to get LZ4 engine");
assert!(lz4_engine.is_supported());
let gzip_engine = compression_engine::get_compression_engine(
CompressionType::GZip
).expect("Failed to get GZip engine");
assert!(gzip_engine.is_supported());
let none_engine = compression_engine::get_compression_engine(
CompressionType::None
).expect("Failed to get None engine");
assert!(none_engine.is_supported());
}
#[test]
fn test_compression_engine_factory_invalid() {
// Test that we get an error for unsupported compression types
// This test assumes that any invalid type would return an error
// In practice, you might want to add an Invalid variant to CompressionType
}
#[test]
fn test_default_compression_type() {
let default = compression_engine::default_compression_type();
// The default should be a supported compression type
let engine = compression_engine::get_compression_engine(default)
.expect("Failed to get default compression engine");
assert!(engine.is_supported());
}
}

View File

@@ -1,10 +0,0 @@
#[cfg(test)]
pub mod factory_tests;
#[cfg(test)]
pub mod conversion_tests;
#[cfg(test)]
mod tests {
use crate::compression_engine::{self, CompressionType};
use std::str::FromStr;
}