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/remix-tests/tests/number/number_test.sol

39 lines
1.3 KiB

pragma solidity ^0.4.24;
contract IntegerTest {
// GREATER THAN [>] tests
6 years ago
function _2_shouldBeGreaterThan_1() public view returns (bool) {
return Assert.greaterThan(uint(2), uint(1), "2 is greater than 1");
}
6 years ago
function _0_shouldBeGreaterThan_neg_1() public view returns (bool) {
return Assert.greaterThan(uint(0), int(-1), "0 is greater than -1");
}
6 years ago
function _neg_1_shouldNotBeGreaterThan_1() public view returns (bool) {
return Assert.greaterThan(int(-1), uint(1), "-1 is not greater than 1");
}
6 years ago
function _1_shouldBeGreaterThan_neg_1() public view returns (bool) {
return Assert.greaterThan(uint(1), int(-1), "1 is greater than -1");
}
// LESSER THAN [<] tests
6 years ago
function _1_shouldBeLesserThan_2() public view returns (bool) {
return Assert.lesserThan(uint(1), uint(2), "1 is lesser than 2");
}
6 years ago
function _neg_1_shouldBeLesserThan_0() public view returns (bool) {
return Assert.lesserThan(int(-1), uint(0), "-1 is lesser than 0");
}
6 years ago
function _neg_2_shouldBeLesserThan_neg_1() public view returns (bool) {
return Assert.lesserThan(int(-2), int(-1), "-2 is lesser than -1");
}
6 years ago
function _0_shouldNotBeLesserThan_neg_1() public view returns (bool) {
return Assert.lesserThan(uint(0), int(-1), "0 is not lesser than -1");
}
}