Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pragma solidity 0.4.19;
- contract MyContract {
- uint[] public myArr;
- MyContract(uint[] _initArr) public {
- for (uint i=0; i < _initArr.length; i++) {
- myArr.push(_initArr[i]);
- }
- }
- function getMyArr public constant returns (uint[]) {
- return myArr;
- }
- }
- pragma solidity 0.4.19;
- import "truffle/Assert.sol";
- import "truffle/DeployedAddresses.sol";
- import "../contracts/MyContract.sol";
- contract TestMyContract {
- function testMyContract() public {
- uint[] storage expectedArr;
- expectedArr.push(0);
- expectedArr.push(1);
- expectedArr.push(2);
- MyContract myContract = new MyContract(expectedArr);
- Assert.equal(myContract.getMyArr(), expectedArr, "pass");
- }
- }
- TypeError: Member "equal" is not available in type(library Assert) outside of storage.
- Assert.equal(myContract.getMyArr(), expectedArr, "pass");
- ^----------^
Add Comment
Please, Sign In to add comment