diff --git a/tests/e2e/src/assertions/mod.rs b/tests/e2e/src/assertions/mod.rs index bd2531c..cf8d1ae 100644 --- a/tests/e2e/src/assertions/mod.rs +++ b/tests/e2e/src/assertions/mod.rs @@ -511,9 +511,9 @@ mod tests { #[test] fn test_embedding_assertions() { - let emb1 = vec![1.0f32, 0.0, 0.0]; - let emb2 = vec![0.9, 0.1, 0.0]; - let emb3 = vec![0.0, 1.0, 0.0]; + let emb1 = [1.0f32, 0.0, 0.0]; + let emb2 = [0.9, 0.1, 0.0]; + let emb3 = [0.0, 1.0, 0.0]; assert_embeddings_similar!(emb1, emb2, 0.8); assert_embeddings_different!(emb1, emb3, 0.5); diff --git a/tests/e2e/src/mocks/mock_embedding.rs b/tests/e2e/src/mocks/mock_embedding.rs index 3b0003b..93f0363 100644 --- a/tests/e2e/src/mocks/mock_embedding.rs +++ b/tests/e2e/src/mocks/mock_embedding.rs @@ -306,7 +306,7 @@ mod tests { let sim = service.cosine_similarity(&emb1, &emb2); // Cosine similarity should be in [-1, 1] - assert!(sim >= -1.0 && sim <= 1.0); + assert!((-1.0..=1.0).contains(&sim)); } #[test] diff --git a/tests/e2e/tests/cognitive/neuroscience_tests.rs b/tests/e2e/tests/cognitive/neuroscience_tests.rs index 1d75a79..5fb2db9 100644 --- a/tests/e2e/tests/cognitive/neuroscience_tests.rs +++ b/tests/e2e/tests/cognitive/neuroscience_tests.rs @@ -22,21 +22,19 @@ use chrono::{Duration, Utc}; use vestige_core::{ // Advanced reconsolidation - AccessContext, AccessTrigger, LabileState, MemorySnapshot, Modification, - ReconsolidatedMemory, ReconsolidationManager, RelationshipType, + AccessContext, AccessTrigger, Modification, ReconsolidationManager, RelationshipType, // FSRS - Rating, retrievability, retrievability_with_decay, initial_difficulty, initial_stability, - next_interval, FSRSScheduler, FSRSState, + Rating, retrievability, retrievability_with_decay, initial_difficulty, + next_interval, FSRSScheduler, // Neuroscience - Synaptic Tagging - SynapticTaggingSystem, SynapticTag, ImportanceEvent, ImportanceEventType, - CaptureWindow, DecayFunction, ImportanceCluster, CapturedMemory, + SynapticTaggingSystem, ImportanceEvent, ImportanceEventType, + CaptureWindow, DecayFunction, // Neuroscience - Memory States - MemoryState, MemoryLifecycle, StateTransitionReason, AccessibilityCalculator, - CompetitionManager, CompetitionCandidate, StateDecayConfig, StateUpdateService, - MemoryStateInfo, + MemoryState, MemoryLifecycle, AccessibilityCalculator, + CompetitionManager, CompetitionCandidate, // Neuroscience - Importance Signals ImportanceSignals, NoveltySignal, ArousalSignal, RewardSignal, AttentionSignal, - ImportanceContext, AccessPattern, AttentionSession, OutcomeType, CompositeWeights, + ImportanceContext, AttentionSession, OutcomeType, }; // ============================================================================ @@ -458,7 +456,7 @@ fn test_fsrs_initial_difficulty_order() { // All within valid bounds (1.0 to 10.0) for d in [d_again, d_hard, d_good, d_easy] { - assert!(d >= 1.0 && d <= 10.0, "Difficulty {} out of bounds", d); + assert!((1.0..=10.0).contains(&d), "Difficulty {} out of bounds", d); } } diff --git a/tests/e2e/tests/cognitive/psychology_tests.rs b/tests/e2e/tests/cognitive/psychology_tests.rs index a464ae4..d89aaed 100644 --- a/tests/e2e/tests/cognitive/psychology_tests.rs +++ b/tests/e2e/tests/cognitive/psychology_tests.rs @@ -9,7 +9,6 @@ use vestige_core::neuroscience::spreading_activation::{ ActivationConfig, ActivationNetwork, LinkType, }; -use std::collections::HashSet; // ============================================================================ // SERIAL POSITION EFFECT TESTS (5 tests) diff --git a/tests/e2e/tests/extreme/adversarial_tests.rs b/tests/e2e/tests/extreme/adversarial_tests.rs index 0bc1f0e..2fcc042 100644 --- a/tests/e2e/tests/extreme/adversarial_tests.rs +++ b/tests/e2e/tests/extreme/adversarial_tests.rs @@ -14,14 +14,9 @@ use vestige_core::neuroscience::spreading_activation::{ ActivationConfig, ActivationNetwork, LinkType, }; -use vestige_core::neuroscience::synaptic_tagging::{ - CaptureWindow, ImportanceEvent, ImportanceEventType, SynapticTaggingSystem, -}; -use vestige_core::neuroscience::hippocampal_index::{ - BarcodeGenerator, HippocampalIndex, -}; +use vestige_core::neuroscience::synaptic_tagging::SynapticTaggingSystem; +use vestige_core::neuroscience::hippocampal_index::HippocampalIndex; use chrono::Utc; -use std::collections::HashSet; // ============================================================================ // MALFORMED INPUT HANDLING (2 tests) diff --git a/tests/e2e/tests/extreme/chaos_tests.rs b/tests/e2e/tests/extreme/chaos_tests.rs index 0b3a760..86f1dd6 100644 --- a/tests/e2e/tests/extreme/chaos_tests.rs +++ b/tests/e2e/tests/extreme/chaos_tests.rs @@ -22,7 +22,6 @@ use vestige_core::neuroscience::synaptic_tagging::{ use vestige_core::neuroscience::hippocampal_index::{ HippocampalIndex, IndexQuery, }; -use std::collections::HashSet; // ============================================================================ // RANDOM OPERATION SEQUENCE TESTS (2 tests) diff --git a/tests/e2e/tests/extreme/mathematical_tests.rs b/tests/e2e/tests/extreme/mathematical_tests.rs index 1b6e970..7a9aadc 100644 --- a/tests/e2e/tests/extreme/mathematical_tests.rs +++ b/tests/e2e/tests/extreme/mathematical_tests.rs @@ -107,7 +107,7 @@ fn test_math_edge_weight_multiplication() { let mut network = ActivationNetwork::with_config(config); // Create edges with different weights - let test_weights = vec![0.1, 0.25, 0.5, 0.75, 1.0]; + let test_weights = [0.1, 0.25, 0.5, 0.75, 1.0]; for (i, &weight) in test_weights.iter().enumerate() { network.add_edge( @@ -349,7 +349,7 @@ fn test_math_embedding_dimensions() { // Compression ratio should be reasonable let compression_ratio = 384.0 / INDEX_EMBEDDING_DIM as f64; assert!( - compression_ratio >= 2.0 && compression_ratio <= 4.0, + (2.0..=4.0).contains(&compression_ratio), "Compression ratio should be 2-4x: {:.2}x", compression_ratio ); diff --git a/tests/e2e/tests/extreme/research_validation_tests.rs b/tests/e2e/tests/extreme/research_validation_tests.rs index 1064abc..2fe7716 100644 --- a/tests/e2e/tests/extreme/research_validation_tests.rs +++ b/tests/e2e/tests/extreme/research_validation_tests.rs @@ -18,7 +18,7 @@ use vestige_core::neuroscience::synaptic_tagging::{ SynapticTaggingSystem, }; use vestige_core::neuroscience::hippocampal_index::{ - HippocampalIndex, HippocampalIndexConfig, IndexQuery, INDEX_EMBEDDING_DIM, + HippocampalIndex, HippocampalIndexConfig, IndexQuery, }; use std::collections::HashSet; diff --git a/tests/e2e/tests/journeys/consolidation_workflow.rs b/tests/e2e/tests/journeys/consolidation_workflow.rs index 5240506..6577c89 100644 --- a/tests/e2e/tests/journeys/consolidation_workflow.rs +++ b/tests/e2e/tests/journeys/consolidation_workflow.rs @@ -16,11 +16,10 @@ use chrono::{Duration, Utc}; use vestige_core::{ advanced::dreams::{ ActivityTracker, ConnectionGraph, ConnectionReason, ConsolidationScheduler, - DreamConfig, DreamMemory, InsightType, MemoryDreamer, + DreamConfig, DreamMemory, MemoryDreamer, }, consolidation::SleepConsolidation, }; -use std::collections::HashSet; // ============================================================================ // HELPER FUNCTIONS diff --git a/tests/e2e/tests/journeys/import_export.rs b/tests/e2e/tests/journeys/import_export.rs index e66c941..fbea1ba 100644 --- a/tests/e2e/tests/journeys/import_export.rs +++ b/tests/e2e/tests/journeys/import_export.rs @@ -290,13 +290,11 @@ fn test_roundtrip_preserves_all_data() { #[test] fn test_selective_export_by_tags() { // Create memories with different tags - let memories = vec![ - ExportedMemory::new("Rust ownership", "concept", vec!["rust", "memory"]), + let memories = [ExportedMemory::new("Rust ownership", "concept", vec!["rust", "memory"]), ExportedMemory::new("Python generators", "concept", vec!["python", "generators"]), ExportedMemory::new("Rust borrowing", "concept", vec!["rust", "borrowing"]), ExportedMemory::new("JavaScript async", "concept", vec!["javascript", "async"]), - ExportedMemory::new("Rust async", "concept", vec!["rust", "async"]), - ]; + ExportedMemory::new("Rust async", "concept", vec!["rust", "async"])]; // Filter by "rust" tag let rust_memories: Vec<_> = memories diff --git a/tests/e2e/tests/journeys/intentions_workflow.rs b/tests/e2e/tests/journeys/intentions_workflow.rs index d873b4a..a9b2b8a 100644 --- a/tests/e2e/tests/journeys/intentions_workflow.rs +++ b/tests/e2e/tests/journeys/intentions_workflow.rs @@ -12,10 +12,9 @@ //! 4. System proactively suggests relevant memories //! 5. User benefits from context-aware assistance -use chrono::Utc; use vestige_core::advanced::intent::{ ActionType, DetectedIntent, IntentDetector, LearningLevel, MaintenanceType, - OptimizationType, ReviewDepth, UserAction, + OptimizationType, UserAction, }; // ============================================================================ @@ -84,7 +83,7 @@ fn test_debugging_intent_detection() { // Verify evidence is captured assert!( - result.evidence.len() > 0 || result.confidence == 0.0, + !result.evidence.is_empty() || result.confidence == 0.0, "Should capture evidence if intent detected" ); diff --git a/tests/e2e/tests/mcp/protocol_tests.rs b/tests/e2e/tests/mcp/protocol_tests.rs index 7c616e1..20bed76 100644 --- a/tests/e2e/tests/mcp/protocol_tests.rs +++ b/tests/e2e/tests/mcp/protocol_tests.rs @@ -119,7 +119,7 @@ fn test_standard_jsonrpc_error_codes() { for (code, message) in error_codes { // All standard codes are in the reserved range - assert!(code <= -32600 && code >= -32700, + assert!((-32700..=-32600).contains(&code), "Standard error code {} ({}) must be in reserved range", code, message); } } @@ -142,7 +142,7 @@ fn test_mcp_specific_error_codes() { for (code, name) in mcp_error_codes { // MCP-specific codes are in the server error range - assert!(code >= -32099 && code <= -32000, + assert!((-32099..=-32000).contains(&code), "MCP error code {} ({}) must be in server error range", code, name); } } diff --git a/tests/e2e/tests/mcp/tool_tests.rs b/tests/e2e/tests/mcp/tool_tests.rs index be01425..4eaaa17 100644 --- a/tests/e2e/tests/mcp/tool_tests.rs +++ b/tests/e2e/tests/mcp/tool_tests.rs @@ -325,7 +325,7 @@ fn test_mark_reviewed_with_rating() { // Rating values: 1=Again, 2=Hard, 3=Good, 4=Easy let rating = tool_call["arguments"]["rating"].as_i64().unwrap(); - assert!(rating >= 1 && rating <= 4, "Rating must be 1-4"); + assert!((1..=4).contains(&rating), "Rating must be 1-4"); let expected_response = json!({ "content": [{ @@ -356,7 +356,7 @@ fn test_mark_reviewed_invalid_rating() { // Rating should be validated let r = tool_call["arguments"]["rating"].as_i64().unwrap(); - assert!(r < 1 || r > 4, "Rating {} should be invalid", r); + assert!(!(1..=4).contains(&r), "Rating {} should be invalid", r); } }