Skip to content

Commit

Permalink
test: add zk fuzz tests (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
elfedy authored Aug 12, 2024
1 parent 2e89169 commit 3c4f171
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/forge/tests/it/zk/fuzz.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//! Fuzz tests.
use crate::{config::*, test_helpers::TEST_DATA_DEFAULT};
use forge::revm::primitives::SpecId;
use foundry_test_utils::Filter;

#[tokio::test(flavor = "multi_thread")]
async fn test_zk_fuzz_avoid_system_addresses() {
let runner = TEST_DATA_DEFAULT.runner_zksync();
let filter = Filter::new("testZkFuzzAvoidSystemAddresses", "ZkFuzzTest", ".*");

TestConfig::with_filter(runner, filter).evm_spec(SpecId::SHANGHAI).run().await;
}
1 change: 1 addition & 0 deletions crates/forge/tests/it/zk/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
mod basic;
mod cheats;
mod contracts;
mod fuzz;
mod logs;
mod repros;
10 changes: 10 additions & 0 deletions testdata/zk/Fuzz.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import "ds-test/test.sol";

contract ZkFuzzTest is DSTest {
function testZkFuzzAvoidSystemAddresses(address addr) public pure {
assert(addr > address(65535));
}
}

0 comments on commit 3c4f171

Please sign in to comment.