-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add skeleton solidity test plugin
This is based on the `@ignored/edr` version that comes from the Solidity Test branch of EDR. We create a skeleton `solidity-test` plugin, that leverages the artifacts manager to find contracts and test contracts and pass them off to the EDR Solidity Test Runner before displaying the results.
- Loading branch information
Showing
12 changed files
with
561 additions
and
19 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
contract Counter { | ||
uint public x; | ||
|
||
function inc() public { | ||
x++; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "./Counter.sol"; | ||
|
||
contract CounterTest { | ||
Counter counter; | ||
|
||
function setUp() public { | ||
counter = new Counter(); | ||
} | ||
|
||
function testInitialValue() public view { | ||
require(counter.x() == 0, "Initial value should be 0"); | ||
} | ||
|
||
function testInc() public { | ||
counter.inc(); | ||
require(counter.x() == 1, "Value after inc should be 1"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.