test(axis): expand unit test coverage for conflict detection#293
test(axis): expand unit test coverage for conflict detection#293EffortlessSteven wants to merge 1 commit into
Conversation
Add 17 new unit tests to crates/flight-axis/src/conflict.rs covering pure-logic paths that did not require RT-thread machinery: - ConflictDetectorConfig defaults and field round-trip via with_config - CurveConflictDetector::default() empty state parity with new() - get_conflicts/get_all_conflicts empty before any analysis - add_sample multi-axis isolation and buffer growth past min_samples * 2 (trim path with fresh timestamps) - clear_conflicts wipes detected_conflicts, sample_buffer, and last_analysis together - analyze_samples returns None below min_samples and for perfectly linear data; returns Some with non-empty resolutions for a step-function response - analyze_linearity handles degenerate (all-same) input without panic - assess_severity thresholds at Critical/High/Medium/Low boundaries - classify_conflict branches for DoubleCurve, ExcessiveNonlinearity, and OpposingCurves - generate_description content per ConflictType - generate_resolutions for ExcessiveNonlinearity (target_strength) and OpposingCurves (gain_factor computation) - ConflictSeverity full ordering via vector sort
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Expands unit-test coverage of
crates/flight-axis/src/conflict.rs. Before this PR the 558-LOC curve-conflict detection module had only 4 inline tests — well below the 70% project target for blocking-tier crates.Adds 17 new
#[test]functions covering:ConflictDetectorConfig::default()field defaultsCurveConflictDetectornew/with_config/Defaultparity, empty-state gettersadd_sample: multi-axis isolation, buffer growth pastmin_samples * 2triggering the trim pathclear_conflictswipes the sample buffer, last-analysis map, and detected-conflicts mapanalyze_samplesNone paths (too-few samples; linear data below threshold); Some path for step-function samplesanalyze_linearitydegenerate input (zero-range) no-panicassess_severityCritical / High / Medium / Low buckets + boundaryclassify_conflictall three branches (DoubleCurve / ExcessiveNonlinearity / OpposingCurves)generate_descriptionper-type stringsgenerate_resolutionsforExcessiveNonlinearityandOpposingCurves(includinggain_factormath)ConflictSeverityOrd/PartialOrd orderingAll tests live in the existing
#[cfg(test)] mod testsblock. No production code modified, no new dependencies.Test plan
cargo test -p flight-axis— 743 unit tests + integration/doctests greencargo test -p flight-axis conflict— all conflict tests passrustfmt --check crates/flight-axis/src/conflict.rscleanGenerated by Claude Code