2021-02-02 07:26:56 +03:00
|
|
|
// Copyright (C) 2019-2021 Aleo Systems Inc.
|
2020-08-18 13:50:26 +03:00
|
|
|
// This file is part of the Leo library.
|
|
|
|
|
|
|
|
// The Leo library is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// The Leo library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with the Leo library. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
2021-03-04 22:09:24 +03:00
|
|
|
use crate::{
|
|
|
|
assert_satisfied,
|
|
|
|
expect_asg_error,
|
|
|
|
expect_compiler_error,
|
|
|
|
generate_main_input,
|
|
|
|
integers::IntegerTester,
|
|
|
|
parse_program,
|
|
|
|
};
|
2020-10-31 03:31:09 +03:00
|
|
|
use leo_ast::InputValue;
|
2021-03-04 22:09:24 +03:00
|
|
|
use leo_input::types::{IntegerType, U64Type, UnsignedIntegerType};
|
2020-06-06 02:35:50 +03:00
|
|
|
|
2020-08-06 04:13:50 +03:00
|
|
|
test_uint!(
|
|
|
|
TestU64,
|
|
|
|
u64,
|
|
|
|
IntegerType::Unsigned(UnsignedIntegerType::U64Type(U64Type {})),
|
|
|
|
UInt64
|
|
|
|
);
|
2020-07-16 05:55:04 +03:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u64_min() {
|
2020-07-31 01:41:03 +03:00
|
|
|
TestU64::test_min();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u64_min_fail() {
|
|
|
|
TestU64::test_min_fail();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u64_max() {
|
2020-07-31 01:41:03 +03:00
|
|
|
TestU64::test_max();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2020-07-31 01:41:03 +03:00
|
|
|
fn test_u64_max_fail() {
|
|
|
|
TestU64::test_max_fail();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u64_add() {
|
|
|
|
TestU64::test_add();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u64_sub() {
|
|
|
|
TestU64::test_sub();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u64_mul() {
|
|
|
|
TestU64::test_mul();
|
|
|
|
}
|
|
|
|
|
2020-06-06 02:35:50 +03:00
|
|
|
#[test]
|
2020-07-16 05:55:04 +03:00
|
|
|
fn test_u64_div() {
|
|
|
|
TestU64::test_div();
|
|
|
|
}
|
2020-06-06 02:35:50 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u64_pow() {
|
|
|
|
TestU64::test_pow();
|
|
|
|
}
|
2020-06-06 02:51:26 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u64_eq() {
|
|
|
|
TestU64::test_eq();
|
|
|
|
}
|
2020-06-06 02:51:26 +03:00
|
|
|
|
2020-08-14 10:25:39 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u64_ne() {
|
|
|
|
TestU64::test_ne();
|
|
|
|
}
|
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u64_ge() {
|
|
|
|
TestU64::test_ge();
|
|
|
|
}
|
2020-06-06 02:51:26 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u64_gt() {
|
|
|
|
TestU64::test_gt();
|
|
|
|
}
|
2020-06-06 02:51:26 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u64_le() {
|
|
|
|
TestU64::test_le();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u64_lt() {
|
|
|
|
TestU64::test_lt();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2020-08-17 05:14:26 +03:00
|
|
|
fn test_u64_console_assert() {
|
|
|
|
TestU64::test_console_assert();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u64_ternary() {
|
|
|
|
TestU64::test_ternary();
|
2020-06-06 02:35:50 +03:00
|
|
|
}
|