Skip to content

Commit 5597951

Browse files
committed
Add ReceiveTest
1 parent 86129a2 commit 5597951

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/std/functions/Receive.t.sol

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.22;
3+
4+
import {MCStateFuzzingTest} from "devkit/MCTest.sol";
5+
import {Receive} from "mc-std/functions/Receive.sol";
6+
7+
contract ReceiveTest is MCStateFuzzingTest {
8+
function setUp() public {
9+
_use(bytes4(0), address(new Receive()));
10+
}
11+
12+
function test_Receive_Success() public {
13+
vm.deal(address(this), 100 ether);
14+
15+
vm.expectEmit(target);
16+
emit Receive.Received(address(this), 100 ether);
17+
target.call{value: 100 ether}("");
18+
19+
assertEq(target.balance, 100 ether);
20+
}
21+
22+
}

0 commit comments

Comments
 (0)