// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import "utils/Test.sol";

contract SimpleStorage {
    uint256 public value;

    function set(uint256 _value) external {
        value = _value;
    }
}

contract Issue5935Test is Test {
    function testFork() public {
        uint256 forkId1 = vm.createFork("mainnet", 18234083);
        uint256 forkId2 = vm.createFork("mainnet", 18234083);
        vm.selectFork(forkId1);
        SimpleStorage myContract = new SimpleStorage();
        myContract.set(42);
        vm.selectFork(forkId2);
        SimpleStorage myContract2 = new SimpleStorage();
        assertEq(myContract2.value(), 0);

        vm.selectFork(forkId1);
        assertEq(myContract.value(), 42);
    }
}
