mirror of
https://github.com/AleoHQ/leo.git
synced 2025-01-02 23:04:12 +03:00
more tests
This commit is contained in:
parent
1cc47e9d08
commit
66286ca88e
13
tests/compiler/address/binary.leo
Normal file
13
tests/compiler/address/binary.leo
Normal file
@ -0,0 +1,13 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: inputs/address1.in
|
||||
*/
|
||||
|
||||
|
||||
function main (x: address) -> bool {
|
||||
let a: address = aleo1fj982yqchhy973kz7e9jk6er7t6qd6jm9anplnlprem507w6lv9spwvfxx;
|
||||
let b = x.eq(a);
|
||||
let c = x.neq(a);
|
||||
return c;
|
||||
}
|
25
tests/compiler/boolean/operator_methods.leo
Normal file
25
tests/compiler/boolean/operator_methods.leo
Normal file
@ -0,0 +1,25 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/false_false.in
|
||||
- inputs/false_true.in
|
||||
- inputs/true_false.in
|
||||
- inputs/true_true.in
|
||||
*/
|
||||
|
||||
function main(a: bool, b: bool) -> bool {
|
||||
// unary
|
||||
let h: bool = a.not();
|
||||
|
||||
// binary
|
||||
let l: bool = a.and(b);
|
||||
let o: bool = a.eq(b);
|
||||
let v: bool = a.nand(b);
|
||||
let w: bool = a.neq(b);
|
||||
let x: bool = a.nor(b);
|
||||
let y: bool = a.or(b);
|
||||
let ar: bool = a.xor(b);
|
||||
|
||||
return h;
|
||||
}
|
29
tests/compiler/field/operator_methods.leo
Normal file
29
tests/compiler/field/operator_methods.leo
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/fields.in
|
||||
*/
|
||||
|
||||
function main(a: field, b: field) -> bool {
|
||||
// unary
|
||||
let f: i8 = a.inv();
|
||||
let g: i8 = a.neg();
|
||||
let i: i8 = a.square();
|
||||
|
||||
// binary
|
||||
let j: i8 = a.add(b);
|
||||
let m: i8 = a.div(b);
|
||||
let o: bool = a.eq(b);
|
||||
let p: bool = a.ge(b);
|
||||
let q: bool = a.gt(b);
|
||||
let r: bool = a.le(b);
|
||||
let s: bool = a.lt(b);
|
||||
let t: i8 = a.mul(b);
|
||||
let w: bool = a.neq(b);
|
||||
let z: i8 = a.pow(2u8);
|
||||
let aa: i8 = a.pow(2u16);
|
||||
let ab: i8 = a.pow(2u32);
|
||||
|
||||
return f;
|
||||
}
|
19
tests/compiler/group/operator_methods.leo
Normal file
19
tests/compiler/group/operator_methods.leo
Normal file
@ -0,0 +1,19 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file: inputs/three.in
|
||||
*/
|
||||
|
||||
function main(a: group, b: group) -> bool {
|
||||
// unary
|
||||
let e: i8 = a.double();
|
||||
let g: i8 = a.neg();
|
||||
|
||||
// binary
|
||||
let j: i8 = a.add(b);
|
||||
let o: bool = a.eq(b);
|
||||
let t: i8 = a.mul(b);
|
||||
let w: bool = a.neq(b);
|
||||
|
||||
return a == b;
|
||||
}
|
20
tests/compiler/scalar/operator_methods.leo
Normal file
20
tests/compiler/scalar/operator_methods.leo
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
namespace: Compile
|
||||
expectation: Pass
|
||||
input_file:
|
||||
- inputs/scalars.in
|
||||
*/
|
||||
|
||||
function main(a: scalar, b: scalar) -> bool {
|
||||
// binary
|
||||
let j: i8 = a.add(b);
|
||||
let o: bool = a.eq(b);
|
||||
let p: bool = a.ge(b);
|
||||
let q: bool = a.gt(b);
|
||||
let r: bool = a.le(b);
|
||||
let s: bool = a.lt(b);
|
||||
let t: i8 = a.mul(b);
|
||||
let w: bool = a.neq(b);
|
||||
|
||||
return a == b;
|
||||
}
|
Loading…
Reference in New Issue
Block a user