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

Crossprop tests for bitwise and blockinfo #309

Merged
merged 9 commits into from
Feb 9, 2024
Prev Previous commit
Next Next commit
tests: randomize block-height
  • Loading branch information
csgui committed Feb 7, 2024
commit f2b2c93c4dfa89d46287be817e3e2d676c758622
2 changes: 1 addition & 1 deletion clar2wasm/src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub fn crosscheck_compare_only(snippet: &str) {
);
}

/// Advance the block height to `count`, and uses the same TestEnvironment instance
/// Advance the block height to `count`, and uses identical TestEnvironment copies
/// to assert the results of a contract snippet running against the compiler and the interpreter.
pub fn crosscheck_compare_only_advancing_tip(snippet: &str, count: u32) {
let mut compiler_env = TestEnvironment::new(StacksEpochId::latest(), ClarityVersion::latest());
Expand Down
8 changes: 4 additions & 4 deletions clar2wasm/tests/wasm-generation/blockinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ proptest! {
#![proptest_config(super::runtime_config())]

#[test]
fn crossprop_blockinfo_within_controlled_range(block_height in 1..=STACKS_BLOCK_HEIGHT_LIMIT) {
fn crossprop_blockinfo_within_controlled_range(block_height in 1..=STACKS_BLOCK_HEIGHT_LIMIT, tip in 1..=80u32) {
for info in &BLOCK_INFO {
crosscheck_compare_only_advancing_tip(&format!("(get-block-info? {info} u{block_height})"), 80)
crosscheck_compare_only_advancing_tip(&format!("(get-block-info? {info} u{block_height})"), tip)
}
}
}
Expand All @@ -45,10 +45,10 @@ proptest! {
#![proptest_config(super::runtime_config())]

# [test]
fn crossprop_blockinfo_burnchain_within_controlled_range(block_height in 1..=BURN_BLOCK_HEIGHT_LIMIT) {
fn crossprop_blockinfo_burnchain_within_controlled_range(block_height in 1..=BURN_BLOCK_HEIGHT_LIMIT, tip in 1..=80u32) {
for info in &BURN_BLOCK_INFO {
crosscheck_compare_only_advancing_tip(
&format!("(get-burn-block-info? {info} u{block_height})"), 80
&format!("(get-burn-block-info? {info} u{block_height})"), tip
)
}
}
Expand Down
Loading