remix-project mirror
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
remix-project/libs/remix-tests/tests/examples_0/assert_equal_test.sol

56 lines
2.0 KiB

import "remix_tests.sol"; // this import is automatically injected by Remix.
contract AssertEqualTest {
function equalUintPassTest() public {
Assert.equal(uint(1), uint(1), "equalUintPassTest passes");
}
function equalUintFailTest() public {
Assert.equal(uint(1), uint(2), "equalUintFailTest fails");
}
function equalIntPassTest() public {
Assert.equal(-1, -1, "equalIntPassTest passes");
}
function equalIntFailTest() public {
Assert.equal(-1, 2, "equalIntFailTest fails");
}
function equalBoolPassTest() public {
Assert.equal(true, true, "equalBoolPassTest passes");
}
function equalBoolFailTest() public {
Assert.equal(true, false, "equalBoolFailTest fails");
}
function equalAddressPassTest() public {
Assert.equal(0x7994f14563F39875a2F934Ce42cAbF48a93FdDA9, 0x7994f14563F39875a2F934Ce42cAbF48a93FdDA9, "equalAddressPassTest passes");
}
function equalAddressFailTest() public {
Assert.equal(0x7994f14563F39875a2F934Ce42cAbF48a93FdDA9, 0x1c6637567229159d1eFD45f95A6675e77727E013, "equalAddressFailTest fails");
}
function equalBytes32PassTest() public {
bytes32 e = 0x72656d6978000000000000000000000000000000000000000000000000000000;
bytes32 r = 0x72656d6978000000000000000000000000000000000000000000000000000000;
Assert.equal(r, e, "equalBytes32PassTest passes");
}
function equalBytes32FailTest() public {
bytes32 e = 0x72656d6978000000000000000000000000000000000000000000000000000000;
bytes32 r = 0x72656d6979000000000000000000000000000000000000000000000000000000;
Assert.equal(r, e, "equalBytes32FailTest fails");
}
function equalStringPassTest() public {
Assert.equal(string("remix"), string("remix"), "equalStringPassTest passes");
}
function equalStringFailTest() public {
Assert.equal(string("remix"), string("remix-tests"), "equalStringFailTest fails");
}
}