fix: resolve 8 integration test compilation errors (#46)
CI / CI (push) Successful in 11m36s
CI / CI (push) Successful in 11m36s
## Problem 8 integration test files failed to compile due to: 1. Ambiguous float types (Rust 2024+ stricter inference) 2. chrono 0.4 API change (`with_hour` removed) 3. Missing `sqlx` + `base64` in `[dev-dependencies]` 4. `<` parsed as generics instead of comparison 5. Incorrect assertion (3^5=243 > 100) ## Fix - Added `f32`/`f64` type annotations to vec declarations and bindings - Replaced `with_hour(0)` with `date_naive().and_hms_opt(0,0,0).unwrap().and_utc()` - Added `sqlx` + `base64` to `[dev-dependencies]` - Wrapped comparison in parens - Fixed assertion: nodes=100 → nodes=1000 ## Validation - `cargo build --release` clean - `cargo test` — 20 test suites, 0 failures - 10 files changed, 46 insertions, 42 deletionsReviewed-on: #46 Co-authored-by: rock <[email protected]>
This commit was merged in pull request #46.
This commit is contained in:
@@ -17,7 +17,7 @@ mod tests {
|
||||
let percentage = (count as f32 / total as f32) * 100.0;
|
||||
|
||||
assert_eq!(count, 42);
|
||||
assert!((percentage - 42.0).abs() < 0.01);
|
||||
assert!((percentage - 42.0_f32).abs() < 0.01);
|
||||
}
|
||||
|
||||
/// Test: Confidence level "high" (0.8+)
|
||||
@@ -52,7 +52,7 @@ mod tests {
|
||||
#[test]
|
||||
fn test_date_range_today() {
|
||||
let now = chrono::Utc::now();
|
||||
let start_of_day = now.with_hour(0).unwrap().with_minute(0).unwrap().with_second(0).unwrap();
|
||||
let start_of_day = now.date_naive().and_hms_opt(0, 0, 0).unwrap().and_utc();
|
||||
|
||||
assert!(now >= start_of_day);
|
||||
}
|
||||
@@ -199,7 +199,7 @@ mod tests {
|
||||
let total = 100;
|
||||
let percentage = (count as f32 / total as f32) * 100.0;
|
||||
|
||||
assert!((percentage - 30.0).abs() < 0.01);
|
||||
assert!((percentage - 30.0_f32).abs() < 0.01);
|
||||
}
|
||||
|
||||
/// Test: Facet percentage with rounding
|
||||
@@ -209,7 +209,7 @@ mod tests {
|
||||
let total = 100;
|
||||
let percentage = (count as f32 / total as f32) * 100.0;
|
||||
|
||||
assert!((percentage - 33.0).abs() < 0.01);
|
||||
assert!((percentage - 33.0_f32).abs() < 0.01);
|
||||
}
|
||||
|
||||
/// Test: Zero total in percentage (edge case)
|
||||
|
||||
Reference in New Issue
Block a user