Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use expect_test to make assertions about circuit properties #978

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/lem/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1799,6 +1799,7 @@ mod tests {
lem::{slot::SlotsCounter, store::Store},
};
use bellpepper_core::{test_cs::TestConstraintSystem, Comparable};
use expect_test::{expect, Expect};
use pasta_curves::pallas::Scalar as Fr;

#[test]
Expand All @@ -1819,9 +1820,12 @@ mod tests {
bit_decomp: 3,
}
);
assert_eq!(cs.num_inputs(), 1);
assert_eq!(cs.aux().len(), 9118);
assert_eq!(cs.num_constraints(), 11064);
let expect_eq = |computed: usize, expected: Expect| {
expected.assert_eq(&computed.to_string());
};
expect_eq(cs.num_inputs(), expect!["1"]);
expect_eq(cs.aux().len(), expect!["9118"]);
expect_eq(cs.num_constraints(), expect!["11064"]);
assert_eq!(func.num_constraints(&store), cs.num_constraints());
}
}
Loading