mirror of
https://github.com/AleoHQ/leo.git
synced 2024-11-11 16:10:09 +03:00
make new tests
This commit is contained in:
parent
d33e69bac8
commit
b79b961610
11
tests/compiler/field/pow_signed.leo
Normal file
11
tests/compiler/field/pow_signed.leo
Normal file
@ -0,0 +1,11 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/fields.in
|
||||
*/
|
||||
|
||||
function main(a: field) -> bool {
|
||||
const negOneField: field = -1field;
|
||||
return negOneField ** 2i8 == 1field;
|
||||
}
|
11
tests/compiler/field/pow_unsigned.leo
Normal file
11
tests/compiler/field/pow_unsigned.leo
Normal file
@ -0,0 +1,11 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/fields.in
|
||||
*/
|
||||
|
||||
function main(a: field) -> bool {
|
||||
const negOneField: field = -1field;
|
||||
return negOneField ** 2u8 == 1field;
|
||||
}
|
5
tests/compiler/group/inputs/one.in
Normal file
5
tests/compiler/group/inputs/one.in
Normal file
@ -0,0 +1,5 @@
|
||||
[main]
|
||||
a: group = (7374112779530666882856915975292384652154477718021969292781165691637980424078, 3435195339177955418892975564890903138308061187980579490487898366607011481796)group;
|
||||
|
||||
[registers]
|
||||
r0: group = (_, _)group;
|
9
tests/compiler/group/mult_by_group_fail.leo
Normal file
9
tests/compiler/group/mult_by_group_fail.leo
Normal file
@ -0,0 +1,9 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
input_file: inputs/one.in
|
||||
*/
|
||||
|
||||
function main(a: group) -> group {
|
||||
return (_, _)group * a;
|
||||
}
|
9
tests/compiler/group/mult_by_scalar.leo
Normal file
9
tests/compiler/group/mult_by_scalar.leo
Normal file
@ -0,0 +1,9 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: inputs/one.in
|
||||
*/
|
||||
|
||||
function main(a: group) -> group {
|
||||
return 1u8 * a;
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: 54e7ff665e23816752eb03e1e93ab90f8348464bac12636baa1d84938e6faccf
|
||||
symbol_table: c04c06d2f689387637bac27fff30cdaa87ec9b49fc03e1fe56b1e04029b6f925
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: 3a50bcc0c4416f93de77861848ac00cd1b40e17f4c023ab3faea0fc0c332f148
|
||||
initial_ast: f5cde73247b7a36bb9021c8c5d60def92773fd994eec0f1ee76738a7a54a8ca0
|
||||
symbol_table: 5527b2434b61b94d365ba1e8bd1c2173b9feef5aa21c99440920259fb7df2052
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Fail
|
||||
outputs:
|
||||
- "Error [ETYC0372007]: Expected one type from `i8,i16,i32,i64,i128,u8,u16,u32,u64,u128,`, but got `group`\n --> compiler-test:4:12\n |\n 4 | return (_, _)group * a;\n | ^^^^^^^^^^^^^^^\nError [ETYC0372007]: Expected one type from `i8,i16,i32,i64,i128,u8,u16,u32,u64,u128,`, but got `group`\n --> compiler-test:4:12\n |\n 4 | return (_, _)group * a;\n | ^^^^^^^^^^^^^^^"
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
outputs:
|
||||
- output:
|
||||
- initial_input_ast: e765a6e8209951902a890e711b0ebb6b22dfd84149ae1a69bce43530008c17c3
|
||||
initial_ast: c1c65a71052cd2891e9eb519955d47ba33327d8a5c6aabdaa35f1dd312aa656b
|
||||
symbol_table: 8e39b2bdad6276a42437b673faa0d1dd4f762a9778de1a1e2c8f8edbe5002be4
|
Loading…
Reference in New Issue
Block a user