mirror of
https://github.com/AleoHQ/leo.git
synced 2024-12-19 15:41:36 +03:00
another test
This commit is contained in:
parent
0240ea27e5
commit
c78ab699b8
13
compiler/tests/circuits/const_self_variable.leo
Normal file
13
compiler/tests/circuits/const_self_variable.leo
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
circuit Foo {
|
||||||
|
a: u8,
|
||||||
|
|
||||||
|
function use_a(const self) -> u8 {
|
||||||
|
return self.a + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
let f = Foo { a: 0u8 };
|
||||||
|
|
||||||
|
console.assert(1u8 == f.use_a());
|
||||||
|
}
|
@ -133,6 +133,14 @@ fn test_member_static_function_undefined() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Constant
|
// Constant
|
||||||
|
#[test]
|
||||||
|
fn test_const_self_variable() {
|
||||||
|
let program_string = include_str!("const_self_variable.leo");
|
||||||
|
let program = parse_program(program_string).unwrap();
|
||||||
|
|
||||||
|
assert_satisfied(program);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_const_self_variable_fail() {
|
fn test_const_self_variable_fail() {
|
||||||
let program_string = include_str!("const_self_variable_fail.leo");
|
let program_string = include_str!("const_self_variable_fail.leo");
|
||||||
|
Loading…
Reference in New Issue
Block a user