Add tests

This commit is contained in:
Pranav Gaddamadugu 2022-10-06 23:32:02 -07:00 committed by d0cd
parent 70051888e8
commit 2354cc8b41
3 changed files with 64 additions and 1 deletions

View File

@ -16,4 +16,5 @@ program test.aleo {
transition main(a: u8, b:u8) -> u8 {
return a + b;
}}
}
}

View File

@ -0,0 +1,26 @@
/*
namespace: Compile
expectation: Pass
*/
// TODO: This should be made into an integration test.
program test.aleo {
record Token {
// The token owner.
owner: address,
// The Aleo balance (in gates).
gates: u64,
// The token amount.
amount: u64,
}
transition main(owner: address, a: u64) -> Token {
let amount: u64 = a * a;
return Token {
amount,
gates: 0u64,
owner,
};
}
}

View File

@ -0,0 +1,36 @@
/*
namespace: Compile
expectation: Pass
*/
// TODO: This should be made into an integration test.
program test.aleo {
struct Foo {
a: u8,
b: u16,
}
struct Bar {
a: u8,
b: u8,
}
transition main(a: u8, b: u16) -> (Foo, Bar) {
let c: u8 = a + a;
let d: u16 = b * b;
let e: Foo = Foo {
b: d,
a: c,
};
let f: Bar = Bar {
b: c,
a: a,
};
return (e, f);
}
}