首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法导入"remix_accounts.sol":文件未找到

无法导入"remix_accounts.sol":文件未找到
EN

Ethereum用户
提问于 2020-09-24 09:23:25
回答 1查看 2.1K关注 0票数 1

我试图用remix编写一些单元测试,但是当我尝试导入时,remix_accounts.sol重组合告诉我无法导入文件,没有找到

代码语言:javascript
复制
pragma solidity >=0.4.22 <0.7.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "remix_accounts.sol";

import "../TeamAtCompany.sol";

// File name has to end with '_test.sol', this file can contain more than one testSuite contracts
contract testSuite {
    TeamAtCompany teamContract;
    /// 'beforeAll' runs before all other tests
    /// More special functions are: 'beforeEach', 'beforeAll', 'afterEach' & 'afterAll'
    function beforeAll() public {
        // teamContract = new TeamAtQredo();
        // Here should instantiate tested contract
        Assert.equal(uint(1), uint(1), "1 should be equal to 1");
    }

    /// #sender: account-9
    function checkSender() public {
        Assert.equal(msg.sender, TestAccounts.getAccount(9),"This is not valid msg.sender");
    }

}
EN

回答 1

Ethereum用户

发布于 2020-10-02 04:03:10

根据‘.’

在Remix中,您将得到错误。

无法导入“remix_accounts.sol”文件未找到“

当您尝试在“”选项卡中编译时。(此选项卡通常是在混合屏幕左侧的第二个或第三个选项卡)。

但是,如果您切换到"Solidity“选项卡(显示两个复选标记的图标的选项卡)并单击该选项卡内的" run”按钮,它应该导入"remix_accounts.sol“而没有错误,并运行单元测试。

如果您没有看到“稳固单元测试”选项卡。然后打开"Plugin“选项卡(带有插件图标的选项卡),然后搜索”“,然后单击" activate”按钮来激活该模块。

票数 1
EN
页面原文内容由Ethereum提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://ethereum.stackexchange.com/questions/87729

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档