2020-07-16 07:55:45 +03:00
|
|
|
use crate::{
|
2020-07-31 02:20:31 +03:00
|
|
|
assert_satisfied,
|
2020-08-17 05:14:26 +03:00
|
|
|
expect_compiler_error,
|
2020-08-01 05:39:30 +03:00
|
|
|
generate_main_input,
|
2020-08-01 00:06:01 +03:00
|
|
|
integers::{expect_computation_error, expect_parsing_error, IntegerTester},
|
2020-07-16 07:55:45 +03:00
|
|
|
parse_program,
|
|
|
|
};
|
2020-08-06 04:13:50 +03:00
|
|
|
use leo_input::types::{I32Type, IntegerType, SignedIntegerType};
|
2020-08-03 06:56:22 +03:00
|
|
|
use leo_typed::InputValue;
|
2020-07-16 07:55:45 +03:00
|
|
|
|
2020-08-06 04:13:50 +03:00
|
|
|
test_int!(
|
|
|
|
TestI32,
|
|
|
|
i32,
|
|
|
|
IntegerType::Signed(SignedIntegerType::I32Type(I32Type {})),
|
|
|
|
Int32
|
|
|
|
);
|
2020-07-16 07:55:45 +03:00
|
|
|
|
2020-07-31 02:20:31 +03:00
|
|
|
#[test]
|
|
|
|
fn test_i32_min() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_min();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2020-07-31 02:20:31 +03:00
|
|
|
fn test_i32_min_fail() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_min_fail();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_max() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_max();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2020-07-31 02:20:31 +03:00
|
|
|
fn test_i32_max_fail() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_max_fail();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
2020-08-05 07:37:09 +03:00
|
|
|
#[test]
|
|
|
|
fn test_i32_neg() {
|
2020-08-06 06:06:33 +03:00
|
|
|
TestI32::test_negate();
|
2020-08-05 07:37:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_neg_max_fail() {
|
2020-08-06 06:06:33 +03:00
|
|
|
TestI32::test_negate_min_fail();
|
2020-08-05 07:37:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_neg_zero() {
|
2020-08-06 06:06:33 +03:00
|
|
|
TestI32::test_negate_zero();
|
2020-08-05 07:37:09 +03:00
|
|
|
}
|
|
|
|
|
2020-07-16 07:55:45 +03:00
|
|
|
#[test]
|
|
|
|
fn test_i32_add() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_add();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_sub() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_sub();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_mul() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_mul();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_div() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_div();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_pow() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_pow();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_eq() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_eq();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
2020-08-14 10:25:39 +03:00
|
|
|
#[test]
|
|
|
|
fn test_i32_ne() {
|
|
|
|
TestI32::test_ne();
|
|
|
|
}
|
|
|
|
|
2020-07-16 07:55:45 +03:00
|
|
|
#[test]
|
|
|
|
fn test_i32_ge() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_ge();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_gt() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_gt();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_le() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_le();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_lt() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_lt();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
2020-08-17 05:14:26 +03:00
|
|
|
fn test_i32_console_assert() {
|
|
|
|
TestI32::test_console_assert();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_i32_ternary() {
|
2020-08-06 04:13:50 +03:00
|
|
|
TestI32::test_ternary();
|
2020-07-16 07:55:45 +03:00
|
|
|
}
|