Increased test coverage#447
Conversation
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
Signed-off-by: Marvin Hansen <marvin.hansen@gmail.com>
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #447 +/- ##
==========================================
+ Coverage 91.73% 93.40% +1.67%
==========================================
Files 830 830
Lines 36953 36951 -2
==========================================
+ Hits 33897 34513 +616
+ Misses 3056 2438 -618 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||||||||
User description
Increased test coverage across multiple crates.
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
For details on make, please see BUILD.md
Note: The CI runs all of the above and fixing things before they hit CI speeds
up the review and merge process. Thank you.
PR Type
Tests
Description
Comprehensive test coverage expansion across multiple crates and modules:
General Relativity: Refactored
gr_ops_impl_tests.rsby extracting metric tests to newmetrics_tests.rsfile; added newadm_state_tests.rsfor ADM constraint calculations; createdgr_lie_mapping_tests.rsfor Lie-Geometric tensor conversionsTopology: Expanded lattice tests with boundary conditions, Betti number calculations, and edge cases; refactored cell complex tests with improved
TestCellhelper and boundary matrix coverage; added manifold tests for constructors, covariance analysis, and display formatting; created gauge field getter and metric convention tests; added graph, hypergraph, point cloud, and topology operation testsPhysics Theories: Added comprehensive electroweak parameter and coupling tests; created weak force theory tests for isospin, coupling calculations, and error paths; expanded electromagnetism tests for field error handling and polarization cases
HAFT (Higher-order Algebraic Functor Types): Created new test modules for alias trait implementations including
AliasFunctor,AliasAdjunction,AliasProfunctor,AliasMonad,AliasCoMonad, andAliasFoldable; added Pure typeclass witness testsCausal Types: Added causaloid error path tests for collection and graph types; created comprehensive getter method tests for all causaloid variants; added causaloid graph node and edge operation error tests
Other: Added interpreter and system state default behavior tests; expanded differential form constructor and operation tests; added simplicial complex structure tests; implemented missing adjunction test logic
Code Enhancement: Refactored Stokes adjunction
counit()andright_adjunct()methods to use direct indexing instead of optional chainingModule Organization: Reorganized general relativity test modules; created new alias trait test module structure; expanded manifold and causaloid test module imports
Diagram Walkthrough
File Walkthrough
41 files
gr_ops_impl_tests.rs
Refactor GR tests - extract metrics and add constraint field coveragedeep_causality_physics/tests/theories/general_relativity/gr_ops_impl_tests.rs
metrics_tests.rsfile(minkowski, schwarzschild, kerr, flrw)
momentum_constraint_field()with various tensorshapes and error cases
kretschmann_scalar()error paths and interface methodslike
solve_geodesic()andparallel_transport()geodesic deviation
metrics_tests.rs
New metrics test file - consolidate spacetime metric testsdeep_causality_physics/tests/theories/general_relativity/metrics_tests.rs
minkowski_metric(),schwarzschild_metric_at(),kerr_metric_at(),flrw_metric_at()schwarzschild_christoffel_at()components andschwarzschild_kretschmann()calculationsparameters, and boundary conditions
adm_state_tests.rs
New ADM state test file - comprehensive constraint testingdeep_causality_physics/tests/theories/general_relativity/adm_state_tests.rs
and operations
constraint calculations
shapes
lattice_test.rs
Expand lattice tests - boundary, betti numbers, and edge casesdeep_causality_topology/tests/types/lattice/lattice_test.rs
Latticetype methodsboundary()andwrap_cell()with periodic and open boundaryconditions
max_dim()across 2D, 3D, and 4D latticesboundary_matrix()shape and composition propertiesbetti_number()calculations on various topologies (torus,open lattice, partial periodic)
num_cells()with zero-sizeddimensions
adjunction_stokes_tests.rs
Add adjunction and stokes operator tests - trait implementationcoveragedeep_causality_topology/tests/extensions/adjunction_stokes_tests.rs
Adjunctiontrait andArcfor shared ownershipStokesContextconstruction fromArcand accessormethods
exterior_derivative()beyond coboundary dimensionboundary()with various chain grades and out-of-boundscases
integrate()with grade matching and mismatchesAdjunctiontrait tests forunit(),left_adjunct(),right_adjunct(), andcounit()methodselectroweak_tests.rs
Add electroweak parameter and coupling tests - comprehensive coveragedeep_causality_physics/tests/theories/electroweak/electroweak_tests.rs
ElectroweakParamsconstructor and coupling calculations(
z_coupling(),cos2_theta_w())w_mass(),z_mass()) and precision modecalculations
ElectroweakOpstrait methods and standard model precisionmode
cell_complex_test.rs
Refactor cell complex tests - add boundary matrix and betti coveragedeep_causality_topology/tests/types/cell_complex/cell_complex_test.rs
MockCelltoTestCellwith proper boundary implementationTestCell(vertex, edge, face) withboundary cell tracking
CellComplexmethodscells_vec()with out-of-bounds and valid dimensionsdimension()on empty complexcompute_boundary_matrix()with various k values and edgecases
betti_number()on single vertex, disconnected vertices,connected graphs, and triangles
CWComplextrait implementation (cells iterator, max_dim,boundary_matrix)
causaloid_singleton_tests.rs
Add causaloid error path tests - collection and context handlingdeep_causality/tests/types/causal_types/causaloid/causaloid_singleton_tests.rs
evaluate()error paths on collection and graph typesNonevalue without errorcertain error branches cannot be tested via public API
weak_force_tests.rs
Add weak force parameter and coupling tests - comprehensive coveragedeep_causality_physics/tests/theories/weak_force/weak_force_tests.rs
WeakIsospinconstruction with valid and boundary casesleft_coupling(),right_coupling())WeakFieldOpstrait methods (fermi_constant(),sin2_theta_w())weak_field_strength()tensor computationhigh-energy propagator behavior
alias_functor_tests.rs
New alias functor tests - witness type coveragedeep_causality_haft/tests/alias/alias_functor_tests.rs
AliasFunctortrait implementationtransform()method onOptionWitnessandVecWitnesstypesmod.rs
Register alias functor test moduledeep_causality_haft/tests/mod.rs
aliastestsgr_lie_mapping_tests.rs
Lie-Geometric tensor conversion testsdeep_causality_physics/tests/theories/general_relativity/gr_lie_mapping_tests.rs
pair_to_lie_index,lie_index_to_pair)constructors_tests.rs
Manifold constructor and validation testsdeep_causality_topology/tests/types/manifold/constructors_tests.rs
new()constructor with data size mismatch and cursor boundsvalidation
with_metric()constructor with edge length validationclone_shallow()and getter methodsem_tests.rs
EM field error handling and edge case testsdeep_causality_physics/tests/theories/electromagnetism/em_tests.rs
plane_wave()with NaN, infinity, andinvalid polarization
from_fields()success test with valid E and B multivectorsfrom_fields()error test for metric mismatch between fieldsgauge_field_tests.rs
Gauge field getter and metric convention testsdeep_causality_topology/tests/types/gauge_field/gauge_field_tests.rs
create_u1_gauge_field()for U(1) gauge fieldcreation
gauge_group_name(),lie_algebra_dim(),is_abelian(),spacetime_dim()causaloid_getters_tests.rs
Causaloid getter methods comprehensive testsdeep_causality/tests/types/causal_types/causaloid/causaloid_getters_tests.rs
pure_tests.rs
Pure typeclass witness testsdeep_causality_haft/tests/algebra/pure_tests.rs
OptionWitness::pure()with various typesResultWitness::pure()with Result type inferenceVecWitness::pure()for vector wrappingdifferential_form_tests.rs
Differential form constructor and operation testsdeep_causality_topology/tests/types/differential_form/differential_form_tests.rs
from_generator()andzero_form_high_degree()is_top_form()andnum_components_various()get()method tests for valid and out-of-bounds accessdegree/dimension, and zero scaling
graph_tests.rs
Graph edge operations and error handling testsdeep_causality_topology/tests/types/graph/graph_tests.rs
create_simple_graph()for test setupadd_edge()error path tests for duplicates, out-of-bounds, andself-loops
has_edge()andneighbors()error path testshypergraph_tests.rs
Hypergraph query and error handling testsdeep_causality_topology/tests/types/hypergraph/hypergraph_tests.rs
create_simple_hypergraph()for test setupnodes_in_hyperedge()andhyperedges_on_node()error path testsnum_hyperedges()andcursor()coverage testshkt_manifold_tests.rs
Manifold Applicative single-function testsdeep_causality_topology/tests/extensions/hkt_manifold_tests.rs
Applicativeimport for new teststest_manifold_applicative_single_func()to test single-functionapply branch
simplicial_topology_tests.rs
Simplicial complex structure and operation testsdeep_causality_topology/tests/types/simplicial_complex/simplicial_topology_tests.rs
SimplicialComplexBuilderimportskeletons(),boundary_operators(),coboundary_operators()Simplex::vertices()testmax_simplex_dimension()andnum_simplices_by_grade()covariance_tests.rs
Manifold covariance and eigenvalue testsdeep_causality_topology/tests/types/manifold/covariance_tests.rs
covariance_matrix()with varied and uniform dataeigen_covariance()for eigenvalue computationpoint_cloud_tests.rs
Point cloud getter and triangulation testsdeep_causality_topology/tests/types/point_cloud/point_cloud_tests.rs
create_point_cloud()for test setuplen(),is_empty(), andcursor()getter testsalias_adjunction_tests.rs
Alias adjunction integration and differentiation testsdeep_causality_haft/tests/alias/alias_adjunction_tests.rs
integrate()(left adjunct alias) anddifferentiate()(rightadjunct alias)
topology_tests.rs
Topology constructor and getter testsdeep_causality_topology/tests/types/topology/topology_tests.rs
create_simple_topology()for test setupnew()grade(),data(),complex(), andcursor()alias_profunctor_tests.rs
Alias profunctor adaptation and mapping testsdeep_causality_haft/tests/alias/alias_profunctor_tests.rs
adapt()(dimap alias),preprocess()(lmap alias),postprocess()(rmap alias)
display_tests.rs
Manifold Display trait implementation testsdeep_causality_topology/tests/types/manifold/display_tests.rs
interpreter_tests.rs
Interpreter and system state default behavior testsdeep_causality/tests/types/generative_types/interpreter_tests.rs
CausalSystemStatedefault and clone testsInterpreterdefault testalias_comonad_tests.rs
Alias CoMonad observation and propagation testsdeep_causality_haft/tests/alias/alias_comonad_tests.rs
observe()(extract alias) andpropagate()(extend alias)causality_graph_nodes_tests.rs
Causaloid graph node management testsdeep_causality/tests/types/causal_types/causaloid_graph/causality_graph_nodes_tests.rs
contains_root_causaloid()andget_root_causaloid()tests forempty graph
is_empty()andclear()tests with size verificationremove_causaloid()error test for invalid indexcausality_graph_edges_tests.rs
Causaloid graph edge operation error testsdeep_causality/tests/types/causal_types/causaloid_graph/causality_graph_edges_tests.rs
add_edge()error test for non-existent nodesadd_edg_with_weight()error test for non-existent nodesremove_edge()error test for non-existent edgealias_monad_tests.rs
Alias Monad chaining and flattening testsdeep_causality_haft/tests/alias/alias_monad_tests.rs
chain()(bind alias) for Option and Vec typesflatten()(join alias) for nested Optionmod.rs
General relativity test module reorganizationdeep_causality_physics/tests/theories/general_relativity/mod.rs
gr_testsmodule to individual test modulesadm_state_tests,gr_lie_mapping_tests,gr_ops_impl_tests,metrics_testsalias_foldable_tests.rs
Alias Foldable reduction testsdeep_causality_haft/tests/alias/alias_foldable_tests.rs
reduce()(fold alias) for vector accumulationmod.rs
Alias trait tests module organizationdeep_causality_haft/tests/alias/mod.rs
functor, monad, profunctor
mod.rs
Manifold test module imports expansiondeep_causality_topology/tests/types/manifold/mod.rs
constructors_tests,covariance_tests, anddisplay_testsmod.rs
Causaloid test module imports expansiondeep_causality/tests/types/causal_types/causaloid/mod.rs
causaloid_getters_testsmodulemod.rs
Gauge field test module configuration adjustmentdeep_causality_topology/tests/types/gauge_field/mod.rs
#[cfg(test)]attribute fromgauge_field_testsmoduledeclaration
mod.rs
Algebra test module pure tests importdeep_causality_haft/tests/algebra/mod.rs
pure_testsmodule with#[cfg(test)]attributeadjunction_tests.rs
Adjunction test implementations completiondeep_causality_haft/tests/algebra/adjunction_tests.rs
left_adjunct()with actual Identity adjunction logicinstead of panic
right_adjunct()with actual Identity adjunction logicinstead of panic
1 files
hkt_adjunction_stokes.rs
Stokes adjunction counit and right_adjunct refactoringdeep_causality_topology/src/extensions/hkt_gauge_field/hkt_adjunction_stokes.rs
counit()to use direct indexing instead of optionalchaining
right_adjunct()to use direct indexing instead of optionalchaining
construction