Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
58abbd47
Unverified
Commit
58abbd47
authored
Apr 14, 2020
by
yann300
Committed by
GitHub
Apr 14, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2722 from ethereum/test-file-update
Generated test file updated
parents
8c5ad13c
fa51a4c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
35 deletions
+24
-35
testTab.js
src/app/tabs/testTab/testTab.js
+24
-35
No files found.
src/app/tabs/testTab/testTab.js
View file @
58abbd47
...
@@ -38,46 +38,35 @@ class TestTabLogic {
...
@@ -38,46 +38,35 @@ class TestTabLogic {
generateTestContractSample
()
{
generateTestContractSample
()
{
return
`pragma solidity >=0.4.0 <0.7.0;
return
`pragma solidity >=0.4.0 <0.7.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "remix_tests.sol"; // this import is automatically injected by Remix.
// file name has to end with '_test.sol'
// file name has to end with '_test.sol'
contract test_1 {
contract test_1 {
function beforeAll() public {
/// 'beforeAll' runs before all other tests
// here should instantiate tested contract
/// More special functions are: 'beforeEach', 'beforeAll', 'afterEach' & 'afterAll'
Assert.equal(uint(4), uint(3), "error in before all function");
function beforeAll() public {
}
// Here should instantiate tested contract
Assert.equal(uint(1), uint(1), "1 should be equal to 1");
function check1() public {
}
// use 'Assert' to test the contract
Assert.equal(uint(2), uint(1), "error message");
Assert.equal(uint(2), uint(2), "error message");
}
function check2() public view returns (bool) {
// use the return value (true or false) to test the contract
return true;
}
}
contract test_2 {
function beforeAll() public {
// here should instantiate tested contract
Assert.equal(uint(4), uint(3), "error in before all function");
}
function check1() public {
function checkSuccess() public {
// use 'Assert' to test the contract
// Use 'Assert' to test the contract,
Assert.equal(uint(2), uint(1), "error message");
// See documentation: https://remix-ide.readthedocs.io/en/latest/assert_library.html
Assert.equal(uint(2), uint(2), "error message");
Assert.equal(uint(2), uint(2), "2 should be equal to 2");
}
Assert.notEqual(uint(2), uint(3), "2 should not be equal to 3");
}
function check
2() public view returns (bool) {
function checkSuccess
2() public view returns (bool) {
//
u
se the return value (true or false) to test the contract
//
U
se the return value (true or false) to test the contract
return true;
return true;
}
}
}`
function checkFailure() public {
Assert.equal(uint(1), uint(2), "1 is not equal to 2");
}
}
`
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment