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
34cf8817
Unverified
Commit
34cf8817
authored
Nov 22, 2018
by
yann300
Committed by
GitHub
Nov 22, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1615 from ethereum/testGeneration
Test generation fixes for solc 0.5.0
parents
637afcf7
abcd7a65
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
test-tab.js
src/app/tabs/test-tab.js
+9
-7
No files found.
src/app/tabs/test-tab.js
View file @
34cf8817
...
@@ -193,7 +193,7 @@ module.exports = class TestTab {
...
@@ -193,7 +193,7 @@ module.exports = class TestTab {
}
}
}
}
var
testContractSample
=
`pragma solidity
^0.4
.0;
var
testContractSample
=
`pragma solidity
>=0.4.0 <0.6
.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'
...
@@ -201,16 +201,17 @@ contract test_1 {
...
@@ -201,16 +201,17 @@ contract test_1 {
function beforeAll() public {
function beforeAll() public {
// here should instantiate tested contract
// here should instantiate tested contract
Assert.equal(uint(4), uint(3), "error in before all function");
}
}
function check1() public {
function check1() public {
// this function is not constant,
use 'Assert' to test the contract
//
use 'Assert' to test the contract
Assert.equal(uint(2), uint(1), "error message");
Assert.equal(uint(2), uint(1), "error message");
Assert.equal(uint(2), uint(2), "error message");
Assert.equal(uint(2), uint(2), "error message");
}
}
function check2() public constant
returns (bool) {
function check2() public view
returns (bool) {
// this function is constant,
use the return value (true or false) to test the contract
//
use the return value (true or false) to test the contract
return true;
return true;
}
}
}
}
...
@@ -219,16 +220,17 @@ contract test_2 {
...
@@ -219,16 +220,17 @@ contract test_2 {
function beforeAll() public {
function beforeAll() public {
// here should instantiate tested contract
// here should instantiate tested contract
Assert.equal(uint(4), uint(3), "error in before all function");
}
}
function check1() public {
function check1() public {
// this function is not constant,
use 'Assert' to test the contract
//
use 'Assert' to test the contract
Assert.equal(uint(2), uint(1), "error message");
Assert.equal(uint(2), uint(1), "error message");
Assert.equal(uint(2), uint(2), "error message");
Assert.equal(uint(2), uint(2), "error message");
}
}
function check2() public constant
returns (bool) {
function check2() public view
returns (bool) {
// this function is constant,
use the return value (true or false) to test the contract
//
use the return value (true or false) to test the contract
return true;
return true;
}
}
}`
}`
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