我有一个用达普工具测试的函数列表,但我只想测试一个函数。我怎样才能做到这一点?
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import "../DappLottery.sol";
import "ds-test/test.sol";
contract DappLotteryTest is DSTest {
DappLottery public dappLottery;
function setUp() public {
dappLottery = new DappLottery();
}
function test_consumer_can_start_lottery() public {
bool response = dappLottery.startLottery();
assertTrue(response);
}
function test_consumer_can_end_lottery() public {
bool response = dappLottery.end();
assertTrue(response);
}
}发布于 2022-01-14 02:09:35
您可以使用-m "match“标志搜索与所需测试名称匹配的regex字符串。
例如:
dapp test -m test_consumer_can_end_lottery或
dapp test -m test_consumer_can_start_lotteryhttps://stackoverflow.com/questions/70705289
复制相似问题