hi, i created the simplest contract form https://www.openzeppelin.com/contracts here and put it in remix and run solidity unit testing. it's giving me this error 1 should not be equal to 1. what is the problem here?
Well, where's the relevant code?
Also, please post everything in plaintext (no links or images), so as to make it easier for readers to copy/paste when answering your question.
Lastly, the error message is kinda ill-phrased in a way, but it tells you that the function being tested should not have returned 1
, yet it has returned 1
.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import "@openzeppelin/contracts@4.8.3/token/ERC20/ERC20.sol";
contract Asda is ERC20 {
constructor() ERC20("asda", "ASD") {
_mint(msg.sender, 420000000000 * 10 ** decimals());
}
}
That's not a unit-test (or any other kind of test).
that's just what i read there.
The screenshot shows that the error comes from another file called tests/zeplin_test.sol
. This is unrelated to the ERC20 token contract you're showing. Check among your Remix files.
oh, thank you. i didn't see that.
That code is saying 1 should not equal 1 and you are wondering why it fails? Even the function name itself says that check should fail, which it does.
Folks, the line you are showing is failing by design. We expect a minimum level of programming skill, but most importantly we need you to show you are making an effort to understand.