1

我有一个我正在尝试使用dapptools测试的功能列表,但我只想测试一个。我该如何做到这一点?

// 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);
    }
}
4

1 回答 1

1

您可以使用-m“匹配”标志来搜索与您想要的测试名称匹配的正则表达式字符串。

例如:

dapp test -m test_consumer_can_end_lottery

或者

dapp test -m test_consumer_can_start_lottery
于 2022-01-14T02:09:35.513 回答