forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrompt.t.sol
32 lines (25 loc) · 889 Bytes
/
Prompt.t.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity 0.8.18;
import "ds-test/test.sol";
import "cheats/Vm.sol";
import "../logs/console.sol";
contract PromptTest is DSTest {
Vm constant vm = Vm(HEVM_ADDRESS);
function testPrompt_revertNotATerminal() public {
// should revert in CI and testing environments either with timout or because no terminal is available
vm._expectCheatcodeRevert();
vm.prompt("test");
vm._expectCheatcodeRevert();
vm.promptSecret("test");
vm._expectCheatcodeRevert();
uint256 test = vm.promptSecretUint("test");
}
function testPrompt_Address() public {
vm._expectCheatcodeRevert();
address test = vm.promptAddress("test");
}
function testPrompt_Uint() public {
vm._expectCheatcodeRevert();
uint256 test = vm.promptUint("test");
}
}