@@ -103,16 +103,16 @@ fn test_evaluate_deterministic_propagation() {
103103
104104 // Case 1: All succeed, chain should be deterministically true.
105105 let effect_success = PropagatingEffect :: Numerical ( 0.99 ) ;
106- let res_success = map
107- . evaluate_deterministic_propagation ( & effect_success , & AggregateLogic :: All )
108- . unwrap ( ) ;
106+ let res = map. evaluate_deterministic_propagation ( & effect_success , & AggregateLogic :: All ) ;
107+ assert ! ( res . is_ok ( ) ) ;
108+ let res_success = res . unwrap ( ) ;
109109 assert_eq ! ( res_success, PropagatingEffect :: Deterministic ( true ) ) ;
110110
111111 // Case 2: One fails, chain should be deterministically false.
112112 let effect_fail = PropagatingEffect :: Numerical ( 0.1 ) ;
113- let res_fail = map
114- . evaluate_deterministic_propagation ( & effect_fail , & AggregateLogic :: All )
115- . unwrap ( ) ;
113+ let res = map. evaluate_deterministic_propagation ( & effect_fail , & AggregateLogic :: All ) ;
114+ assert ! ( res . is_ok ( ) ) ;
115+ let res_fail = res . unwrap ( ) ;
116116 assert_eq ! ( res_fail, PropagatingEffect :: Deterministic ( false ) ) ;
117117}
118118
@@ -123,17 +123,17 @@ fn test_evaluate_probabilistic_propagation() {
123123 // Case 1: All succeed (Deterministic(true) is treated as probability 1.0).
124124 // The cumulative probability should be 1.0.
125125 let effect_success = PropagatingEffect :: Numerical ( 0.99 ) ;
126- let res_success = map
127- . evaluate_probabilistic_propagation ( & effect_success , & AggregateLogic :: All , 0.5 )
128- . unwrap ( ) ;
126+ let res = map. evaluate_probabilistic_propagation ( & effect_success , & AggregateLogic :: All , 0.5 ) ;
127+ assert ! ( res . is_ok ( ) ) ;
128+ let res_success = res . unwrap ( ) ;
129129 assert_eq ! ( res_success, PropagatingEffect :: Probabilistic ( 1.0 ) ) ;
130130
131131 // Case 2: One fails (Deterministic(false) is treated as probability 0.0).
132132 // The chain should short-circuit and return a cumulative probability of 0.0.
133133 let effect_fail = PropagatingEffect :: Numerical ( 0.1 ) ;
134- let res_fail = map
135- . evaluate_probabilistic_propagation ( & effect_fail , & AggregateLogic :: All , 0.5 )
136- . unwrap ( ) ;
134+ let res = map. evaluate_probabilistic_propagation ( & effect_fail , & AggregateLogic :: All , 0.5 ) ;
135+ assert ! ( res . is_ok ( ) ) ;
136+ let res_fail = res . unwrap ( ) ;
137137 assert_eq ! ( res_fail, PropagatingEffect :: Probabilistic ( 0.0 ) ) ;
138138}
139139
@@ -143,9 +143,9 @@ fn test_evaluate_mixed_propagation() {
143143
144144 // Case 1: All succeed, chain remains deterministically true.
145145 let effect_success = PropagatingEffect :: Numerical ( 0.99 ) ;
146- let res_success = map
147- . evaluate_mixed_propagation ( & effect_success , & AggregateLogic :: All , 0.5 )
148- . unwrap ( ) ;
146+ let res = map. evaluate_mixed_propagation ( & effect_success , & AggregateLogic :: All , 0.5 ) ;
147+ assert ! ( res . is_ok ( ) ) ;
148+ let res_success = res . unwrap ( ) ;
149149 // All mixed cased evaluate
150150 assert_eq ! ( res_success, PropagatingEffect :: Deterministic ( true ) ) ;
151151}
@@ -156,8 +156,8 @@ fn test_evaluate_mixed_propagation_err() {
156156
157157 //
158158 let effect_fail = PropagatingEffect :: Numerical ( 0.1 ) ;
159- let res_fail = map. evaluate_mixed_propagation ( & effect_fail, & AggregateLogic :: All , 0.5 ) ;
160- assert ! ( res_fail . is_err( ) ) ;
159+ let res = map. evaluate_mixed_propagation ( & effect_fail, & AggregateLogic :: All , 0.5 ) ;
160+ assert ! ( res . is_err( ) ) ;
161161}
162162
163163#[ test]
@@ -166,7 +166,9 @@ fn test_explain() {
166166 activate_all_causes ( & map) ;
167167
168168 let single_explanation = "Causaloid: 1 'tests whether data exceeds threshold of 0.55' evaluated to: PropagatingEffect::Deterministic(true)" ;
169- let actual = map. explain ( ) . unwrap ( ) ;
169+ let res = map. explain ( ) ;
170+ assert ! ( res. is_ok( ) ) ;
171+ let actual = res. unwrap ( ) ;
170172
171173 // HashMap iteration order is not guaranteed.
172174 // We check that the explanation for each of the 3 causes is present.
0 commit comments