Tracking issue: #391 — Improve test coverage significantly (staged plan).
Scope
Edge cases and property-based invariant tests on core linalg and related primitives. Introduces proptest as a dev-dependency.
Tasks
Add proptest to [dev-dependencies] in Cargo.toml.
src/linalg/basic/arrays.rs (2,174 LOC, 49 existing tests but huge surface) and src/linalg/basic/matrix.rs: add #[should_panic] tests for shape mismatches and edge-case tests for empty arrays, single-element, 1×N / N×1, mismatched concat, out-of-bounds take, degenerate matmul.
Property-based invariant tests with proptest:
matmul : associativity (AB)C = A(BC) where shapes allow, distributivity over addition, (AB)ᵀ = BᵀAᵀ, A·I = A.
transpose : involution (Aᵀ)ᵀ = A.
reshape : preserves total element count.
dot : symmetry of dot product.
src/algorithm/sort/: property tests — quick_argsort and heap_select yield valid permutations, sorting is idempotent, sorted order holds.
src/metrics/distance/: property tests — symmetry d(a,b) = d(b,a), triangle inequality (Minkowski/Euclidean/Manhattan), d(a,a) = 0, Hamming invariance under permutation.
Verification
cargo test --all-features
cargo fmt --all -- --check
cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings
Do you want to work on this issue?
yes — PR will target development.
Tracking issue: #391 — Improve test coverage significantly (staged plan).
Scope
Edge cases and property-based invariant tests on core
linalgand related primitives. Introducesproptestas a dev-dependency.Tasks
proptestto[dev-dependencies]inCargo.toml.src/linalg/basic/arrays.rs(2,174 LOC, 49 existing tests but huge surface) andsrc/linalg/basic/matrix.rs: add#[should_panic]tests for shape mismatches and edge-case tests for empty arrays, single-element, 1×N / N×1, mismatchedconcat, out-of-boundstake, degenerate matmul.proptest:(AB)C = A(BC)where shapes allow, distributivity over addition,(AB)ᵀ = BᵀAᵀ,A·I = A.(Aᵀ)ᵀ = A.src/algorithm/sort/: property tests —quick_argsortandheap_selectyield valid permutations, sorting is idempotent, sorted order holds.src/metrics/distance/: property tests — symmetryd(a,b) = d(b,a), triangle inequality (Minkowski/Euclidean/Manhattan),d(a,a) = 0, Hamming invariance under permutation.Verification
cargo test --all-featurescargo fmt --all -- --checkcargo clippy --all-features -- -Drust-2018-idioms -DwarningsDo you want to work on this issue?
yes — PR will target
development.