Guest User

Untitled

a guest
Feb 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. pragma solidity 0.4.19;
  2.  
  3. contract MyContract {
  4. uint[] public myArr;
  5.  
  6. MyContract(uint[] _initArr) public {
  7. for (uint i=0; i < _initArr.length; i++) {
  8. myArr.push(_initArr[i]);
  9. }
  10. }
  11.  
  12. function getMyArr public constant returns (uint[]) {
  13. return myArr;
  14. }
  15. }
  16.  
  17. pragma solidity 0.4.19;
  18.  
  19. import "truffle/Assert.sol";
  20. import "truffle/DeployedAddresses.sol";
  21. import "../contracts/MyContract.sol";
  22.  
  23. contract TestMyContract {
  24. function testMyContract() public {
  25. uint[] storage expectedArr;
  26. expectedArr.push(0);
  27. expectedArr.push(1);
  28. expectedArr.push(2);
  29.  
  30. MyContract myContract = new MyContract(expectedArr);
  31.  
  32. Assert.equal(myContract.getMyArr(), expectedArr, "pass");
  33. }
  34. }
  35.  
  36. TypeError: Member "equal" is not available in type(library Assert) outside of storage.
  37. Assert.equal(myContract.getMyArr(), expectedArr, "pass");
  38. ^----------^
Add Comment
Please, Sign In to add comment