Skip to content

Commit 8621e54

Browse files
mattssemikelodder7
authored andcommitted
test: add test for foundry-rs#5808 (foundry-rs#5809)
1 parent 665089d commit 8621e54

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

crates/evm/src/executor/inspector/cheatcodes/ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ fn parse_json(json_str: &str, key: &str, coerce: Option<ParamType>) -> Result {
341341
s.retain(|c: char| c != '"');
342342
s
343343
};
344-
trace!(target : "forge::evm", ?values, "parsign values");
344+
trace!(target : "forge::evm", ?values, "parsing values");
345345
return if let Some(array) = values[0].as_array() {
346346
parse::parse_array(array.iter().map(to_string), &coercion_type)
347347
} else {

crates/forge/tests/it/repros.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,3 +289,9 @@ async fn test_issue_5038() {
289289
async fn test_issue_3792() {
290290
test_repro!("Issue3792");
291291
}
292+
293+
// <https://github.com/foundry-rs/foundry/issues/5808>
294+
#[tokio::test(flavor = "multi_thread")]
295+
async fn test_issue_5808() {
296+
test_repro!("Issue5808");
297+
}

testdata/repros/Issue5808.t.sol

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity 0.8.18;
3+
4+
import "ds-test/test.sol";
5+
import "../cheats/Vm.sol";
6+
7+
// https://github.com/foundry-rs/foundry/issues/5808
8+
contract Issue5808Test is DSTest {
9+
Vm constant vm = Vm(HEVM_ADDRESS);
10+
11+
function testReadInt() public {
12+
string memory json = '["ffffffff","00000010"]';
13+
int256[] memory ints = vm.parseJsonIntArray(json, "");
14+
assertEq(ints[0], 4294967295);
15+
assertEq(ints[1], 10);
16+
}
17+
}

0 commit comments

Comments
 (0)