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

test: add zk fuzz tests #510

Merged
merged 2 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
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
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));
}
}
Loading