|
|
@ -199,8 +199,9 @@ 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 pure { |
|
|
|
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 { |
|
|
@ -209,7 +210,7 @@ contract test_1 { |
|
|
|
Assert.equal(uint(2), uint(2), "error message"); |
|
|
|
Assert.equal(uint(2), uint(2), "error message"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function check2() pure public returns (bool) { |
|
|
|
function check2() public view returns (bool) { |
|
|
|
// 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; |
|
|
|
} |
|
|
|
} |
|
|
@ -217,8 +218,9 @@ contract test_1 { |
|
|
|
|
|
|
|
|
|
|
|
contract test_2 { |
|
|
|
contract test_2 { |
|
|
|
|
|
|
|
|
|
|
|
function beforeAll() public pure { |
|
|
|
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 { |
|
|
@ -227,7 +229,7 @@ contract test_2 { |
|
|
|
Assert.equal(uint(2), uint(2), "error message"); |
|
|
|
Assert.equal(uint(2), uint(2), "error message"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function check2() public pure returns (bool) { |
|
|
|
function check2() public view returns (bool) { |
|
|
|
// 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; |
|
|
|
} |
|
|
|
} |
|
|
|