Add tests for expr statements

This commit is contained in:
d0cd 2022-11-11 21:02:59 -08:00
parent af8b63d12a
commit cf9948e99c
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,16 @@
/*
namespace: Compile
expectation: Pass
*/
program test.aleo {
function foo(a: u8, b: u8) -> () {
console.assert_eq(a, b);
}
transition main(a: u8, b: u8) -> u8 {
foo(a, b);
return a + b;
}
}

View File

@ -0,0 +1,26 @@
/*
namespace: Compile
expectation: Fail
*/
program test.aleo {
struct Foo {
a: u8,
}
transition foo(flag: bool, a: u8, b: u8, foo: Foo, i: i8) -> u8 {
a + b;
flag ? a : b;
foo.a;
Foo {
a: a,
};
a;
1u8;
-i8;
();
return a + b;
}
}