2020-06-06 00:09:12 +03:00
|
|
|
use crate::{
|
2020-07-31 01:41:03 +03:00
|
|
|
assert_satisfied,
|
|
|
|
expect_synthesis_error,
|
2020-08-01 05:39:30 +03:00
|
|
|
generate_main_input,
|
2020-08-01 00:06:01 +03:00
|
|
|
integers::{expect_parsing_error, IntegerTester},
|
2020-06-09 05:13:47 +03:00
|
|
|
parse_program,
|
2020-06-06 00:09:12 +03:00
|
|
|
};
|
2020-08-06 04:13:50 +03:00
|
|
|
use leo_input::types::{IntegerType, U32Type, UnsignedIntegerType};
|
2020-08-03 06:56:22 +03:00
|
|
|
use leo_typed::InputValue;
|
2020-05-20 01:45:40 +03:00
|
|
|
|
2020-08-06 04:13:50 +03:00
|
|
|
test_uint!(
|
|
|
|
TestU32,
|
|
|
|
u32,
|
|
|
|
IntegerType::Unsigned(UnsignedIntegerType::U32Type(U32Type {})),
|
|
|
|
UInt32
|
|
|
|
);
|
2020-06-09 05:13:47 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u32_min() {
|
2020-07-31 01:41:03 +03:00
|
|
|
TestU32::test_min();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u32_min_fail() {
|
|
|
|
TestU32::test_min_fail();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u32_max() {
|
2020-07-31 01:41:03 +03:00
|
|
|
TestU32::test_max();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
2020-06-09 05:13:47 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
2020-07-31 01:41:03 +03:00
|
|
|
fn test_u32_max_fail() {
|
|
|
|
TestU32::test_max_fail();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
2020-06-09 05:13:47 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u32_add() {
|
2020-06-09 05:13:47 +03:00
|
|
|
TestU32::test_add();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u32_sub() {
|
|
|
|
TestU32::test_sub();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u32_mul() {
|
2020-06-09 05:13:47 +03:00
|
|
|
TestU32::test_mul();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u32_div() {
|
2020-06-09 05:13:47 +03:00
|
|
|
TestU32::test_div();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
2020-06-09 05:13:47 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u32_pow() {
|
|
|
|
TestU32::test_pow();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u32_eq() {
|
2020-06-09 05:13:47 +03:00
|
|
|
TestU32::test_eq();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_u32_ge() {
|
2020-06-09 05:13:47 +03:00
|
|
|
TestU32::test_ge();
|
2020-07-16 05:55:04 +03:00
|
|
|
}
|
2020-06-09 05:13:47 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u32_gt() {
|
|
|
|
TestU32::test_gt();
|
2020-06-09 05:13:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2020-07-16 05:55:04 +03:00
|
|
|
fn test_u32_le() {
|
|
|
|
TestU32::test_le();
|
|
|
|
}
|
2020-06-09 05:13:47 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u32_lt() {
|
|
|
|
TestU32::test_lt();
|
2020-06-09 05:13:47 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2020-07-16 05:55:04 +03:00
|
|
|
fn test_u32_assert_eq() {
|
|
|
|
TestU32::test_assert_eq();
|
|
|
|
}
|
2020-06-09 05:13:47 +03:00
|
|
|
|
2020-07-16 05:55:04 +03:00
|
|
|
#[test]
|
|
|
|
fn test_u32_ternary() {
|
|
|
|
TestU32::test_ternary();
|
2020-06-09 05:13:47 +03:00
|
|
|
}
|