Skip to content

Commit 871aba5

Browse files
authored
test: add repro test for skip (#6189)
1 parent 60ec002 commit 871aba5

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

crates/forge/tests/it/repros.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,3 +319,9 @@ async fn test_issue_6170() {
319319
assert_eq!(test.status, TestStatus::Failure);
320320
assert_eq!(test.reason, Some("log != expected log".to_string()));
321321
}
322+
323+
// <https://github.com/foundry-rs/foundry/issues/6180>
324+
#[tokio::test(flavor = "multi_thread")]
325+
async fn test_issue_6180() {
326+
test_repro!("Issue6180");
327+
}

testdata/cheats/Vm.sol

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

testdata/repros/Issue6180.sol

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// SPDX-License-Identifier: Unlicense
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/6180
8+
contract Issue6180Test is DSTest {
9+
Vm constant vm = Vm(HEVM_ADDRESS);
10+
11+
function test_timebug() external {
12+
uint256 start = block.timestamp;
13+
uint256 count = 4;
14+
uint256 duration = 15;
15+
for (uint256 i; i < count; i++) {
16+
vm.warp(block.timestamp + duration);
17+
}
18+
19+
uint256 end = block.timestamp;
20+
assertEq(end, start + count * duration);
21+
assertEq(end - start, count * duration);
22+
}
23+
}

0 commit comments

Comments
 (0)