diff --git a/tests/compiler/integers/i128/inputs/pow.in b/tests/compiler/integers/i128/inputs/pow.in new file mode 100644 index 0000000000..e6681c9ac9 --- /dev/null +++ b/tests/compiler/integers/i128/inputs/pow.in @@ -0,0 +1,7 @@ +[main] +a: i128 = 2i128; +b: i128 = 2i128; +c: i128 = 4i128; + +[registers] +r0: bool = true; diff --git a/tests/compiler/integers/i128/pow.leo b/tests/compiler/integers/i128/pow_fail.leo similarity index 52% rename from tests/compiler/integers/i128/pow.leo rename to tests/compiler/integers/i128/pow_fail.leo index 0d1508184a..b99bfa4434 100644 --- a/tests/compiler/integers/i128/pow.leo +++ b/tests/compiler/integers/i128/pow_fail.leo @@ -1,3 +1,9 @@ +/* +namespace: Compile +expectation: Fail +input_file: inputs/pow.in +*/ + function main(a: i128, b: i128, c: i128) -> bool { return a ** b == c; } diff --git a/tests/compiler/integers/i32/inputs/pow.in b/tests/compiler/integers/i32/inputs/pow.in new file mode 100644 index 0000000000..4eecd93a3e --- /dev/null +++ b/tests/compiler/integers/i32/inputs/pow.in @@ -0,0 +1,7 @@ +[main] +a: i32 = 2i32; +b: i32 = 2i32; +c: i32 = 4i32; + +[registers] +r0: bool = true; \ No newline at end of file diff --git a/tests/compiler/integers/i32/pow.leo b/tests/compiler/integers/i32/pow_fail.leo similarity index 51% rename from tests/compiler/integers/i32/pow.leo rename to tests/compiler/integers/i32/pow_fail.leo index 2db0063b3d..f23f39c719 100644 --- a/tests/compiler/integers/i32/pow.leo +++ b/tests/compiler/integers/i32/pow_fail.leo @@ -1,3 +1,9 @@ +/* +namespace: Compile +expectation: Fail +input_file: inputs/pow.in +*/ + function main(a: i32, b: i32, c: i32) -> bool { return a ** b == c; } diff --git a/tests/compiler/integers/i64/inputs/pow.in b/tests/compiler/integers/i64/inputs/pow.in new file mode 100644 index 0000000000..2c51c46f5c --- /dev/null +++ b/tests/compiler/integers/i64/inputs/pow.in @@ -0,0 +1,7 @@ +[main] +a: i64 = 2i64; +b: i64 = 2i64; +c: i64 = 4i64; + +[registers] +r0: bool = true; diff --git a/tests/compiler/integers/i64/pow.leo b/tests/compiler/integers/i64/pow.leo deleted file mode 100644 index d0ee63b639..0000000000 --- a/tests/compiler/integers/i64/pow.leo +++ /dev/null @@ -1,3 +0,0 @@ -function main(a: i64, b: i64) -> bool { - return a ** 4 == b; -} diff --git a/tests/compiler/integers/i64/pow_fail.leo b/tests/compiler/integers/i64/pow_fail.leo new file mode 100644 index 0000000000..9c39be76a4 --- /dev/null +++ b/tests/compiler/integers/i64/pow_fail.leo @@ -0,0 +1,9 @@ +/* +namespace: Compile +expectation: Fail +input_file: inputs/pow.in +*/ + +function main(a: i64, b: i64, c: i64) -> bool { + return a ** b == c; +} diff --git a/tests/compiler/integers/u128/inputs/pow.in b/tests/compiler/integers/u128/inputs/pow.in new file mode 100644 index 0000000000..32ed8514d0 --- /dev/null +++ b/tests/compiler/integers/u128/inputs/pow.in @@ -0,0 +1,7 @@ +[main] +a: u128 = 2u128; +b: u128 = 2u128; +c: u128 = 4u128; + +[registers] +r0: bool = true; diff --git a/tests/compiler/integers/u128/pow.leo b/tests/compiler/integers/u128/pow.leo index aa291182a2..afbf43a58d 100644 --- a/tests/compiler/integers/u128/pow.leo +++ b/tests/compiler/integers/u128/pow.leo @@ -1,3 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/pow.in + +# This test might take to long to fully compile. +# If necessary we could move it to disabled_tests. +*/ + function main(a: u128, b: u128, c: u128) -> bool { return a ** b == c; } diff --git a/tests/compiler/integers/u32/inputs/pow.in b/tests/compiler/integers/u32/inputs/pow.in new file mode 100644 index 0000000000..3dd49fd360 --- /dev/null +++ b/tests/compiler/integers/u32/inputs/pow.in @@ -0,0 +1,7 @@ +[main] +a: u32 = 2u32; +b: u32 = 2u32; +c: u32 = 4u32; + +[registers] +r0: bool = true; diff --git a/tests/compiler/integers/u32/pow.leo b/tests/compiler/integers/u32/pow.leo index b00477b40f..ee514c8186 100644 --- a/tests/compiler/integers/u32/pow.leo +++ b/tests/compiler/integers/u32/pow.leo @@ -1,3 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/pow.in + +# This test might take to long to fully compile. +# If necessary we could move it to disabled_tests. +*/ + function main(a: u32, b: u32, c: u32) -> bool { return a ** b == c; } diff --git a/tests/compiler/integers/u64/inputs/pow.in b/tests/compiler/integers/u64/inputs/pow.in new file mode 100644 index 0000000000..7e2528f38c --- /dev/null +++ b/tests/compiler/integers/u64/inputs/pow.in @@ -0,0 +1,7 @@ +[main] +a: u64 = 2u64; +b: u64 = 2u64; +c: u64 = 4u64; + +[registers] +r0: bool = true; diff --git a/tests/compiler/integers/u64/pow.leo b/tests/compiler/integers/u64/pow.leo index 3b47d849fa..ecf347a347 100644 --- a/tests/compiler/integers/u64/pow.leo +++ b/tests/compiler/integers/u64/pow.leo @@ -1,3 +1,12 @@ +/* +namespace: Compile +expectation: Pass +input_file: inputs/pow.in + +# This test might take to long to fully compile. +# If necessary we could move it to disabled_tests. +*/ + function main(a: u64, b: u64, c: u64) -> bool { return a ** b == c; } diff --git a/tests/expectations/compiler/compiler/integers/i128/pow_fail.leo.out b/tests/expectations/compiler/compiler/integers/i128/pow_fail.leo.out new file mode 100644 index 0000000000..ce77e835b6 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i128/pow_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372009]: The second operand must be a unsigned int but got type `i128`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^\nError [ETYC0372009]: The second operand must be a unsigned int but got type `i128`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i32/pow_fail.leo.out b/tests/expectations/compiler/compiler/integers/i32/pow_fail.leo.out new file mode 100644 index 0000000000..6ab79e0078 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i32/pow_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372009]: The second operand must be a unsigned int but got type `i32`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^\nError [ETYC0372009]: The second operand must be a unsigned int but got type `i32`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/i64/pow_fail.leo.out b/tests/expectations/compiler/compiler/integers/i64/pow_fail.leo.out new file mode 100644 index 0000000000..33f5f70ebb --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/i64/pow_fail.leo.out @@ -0,0 +1,5 @@ +--- +namespace: Compile +expectation: Fail +outputs: + - "Error [ETYC0372009]: The second operand must be a unsigned int but got type `i64`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^\nError [ETYC0372009]: The second operand must be a unsigned int but got type `i64`\n --> compiler-test:4:17\n |\n 4 | return a ** b == c;\n | ^" diff --git a/tests/expectations/compiler/compiler/integers/u128/pow.leo.out b/tests/expectations/compiler/compiler/integers/u128/pow.leo.out new file mode 100644 index 0000000000..eb04f12f26 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u128/pow.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: f7022770406b07fcb59e741b04516838beabbaf118f1cf2c72501cf477a695ef + initial_ast: 5c54a5764d818cb3c119b4a11838429264a322b6b5e0f3704023d0c3b574fca1 + symbol_table: 1a86ec5eeebf868096a4c47fad1543b602498f25d83a5644d9df7f25080b7ba5 diff --git a/tests/expectations/compiler/compiler/integers/u32/pow.leo.out b/tests/expectations/compiler/compiler/integers/u32/pow.leo.out new file mode 100644 index 0000000000..d1bd51c4e9 --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u32/pow.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: f9febc6a7e8f4c36c6878e06f30eb30808f02ab434ea7dc520407bb15eb8c37b + initial_ast: f219aee9d632f2fa97353572c3d6837d7b73bdce07e7b4607e66cee074e52694 + symbol_table: 677671ae8d98952b07ca76432359d4fd3ae39d6d68493aa94856ef1525cbe18f diff --git a/tests/expectations/compiler/compiler/integers/u64/pow.leo.out b/tests/expectations/compiler/compiler/integers/u64/pow.leo.out new file mode 100644 index 0000000000..cc8d6d4adb --- /dev/null +++ b/tests/expectations/compiler/compiler/integers/u64/pow.leo.out @@ -0,0 +1,8 @@ +--- +namespace: Compile +expectation: Pass +outputs: + - output: + - initial_input_ast: dc741dca85c7ced073969a884df08515f767765ad7dcc43f285b77a87cb97de7 + initial_ast: 1f704360566c3d8bfc9b0ac406fa21fdb19e03c5cf35371b7cfa40568d23dc65 + symbol_table: 451fdce6bd78e62017970c8309ad463b1aa18b153657f53fb57efdd6cd06f14e