Skip to content

Commit 7c4c4ec

Browse files
committed
fix(tests): more testing of linear relations
1 parent 469794c commit 7c4c4ec

File tree

6 files changed

+36
-449
lines changed

6 files changed

+36
-449
lines changed

src/linear_relation/mod.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,15 @@ impl<G: PrimeGroup> GroupMap<G> {
160160
///
161161
/// Returns [`Error::UnassignedGroupVar`] if a value is not assigned.
162162
pub fn get(&self, var: GroupVar<G>) -> Result<G, Error> {
163-
self.0[var.0].ok_or(Error::UnassignedGroupVar {
164-
var_debug: format!("{var:?}"),
165-
})
163+
match self.0.get(var.0) {
164+
Some(Some(elem)) => Ok(*elem),
165+
Some(None) => Err(Error::UnassignedGroupVar {
166+
var_debug: format!("{var:?}"),
167+
}),
168+
None => Err(Error::UnassignedGroupVar {
169+
var_debug: format!("{var:?}"),
170+
}),
171+
}
166172
}
167173

168174
/// Iterate over the assigned variable and group element pairs in this mapping.

src/tests/composition.rs

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/tests/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
mod composition;
2-
mod relations;
31
mod spec;
4-
pub mod test_utils;
2+
3+
mod test_composition;
4+
mod test_relations;
55
mod test_validation_criteria;

src/tests/relations.rs

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)