Hi,
I am trying to compare the value returned by getName() using assert.equal(), but I am not getting any message:
pragma solidity >= 0.5.0 < 0.7.0;
contract SimpleContract {
string public name;
constructor() public {
name = 'abs';
}
function getName() public view returns(string memory) {
return (name);
}
}
I am trying to print a message on ‘truffle console’ using assert.equal(), but I am not getting any output.
My truffle console statements are:
> truffle(development)> sci = await SimpleContract.at('0xDa0463c841E7D822f6281240cD7593bA3FD4BB0f');
> undefined
> truffle(development)> value = await sci.getName();
> truffle(development)> await sci.getName();
> 'abs'
> truffle(development)> value = await sci.getName();
> undefined
> truffle(development)> assert.equal(value, 'abs', "Both are equal");
> undefined
> truffle(development)>
Somebody please guide me how to print the message “Both are equal” using truffle console.