leo/compiler/tests/statements/conditional/mutate.leo

16 lines
202 B
Plaintext
Raw Normal View History

2020-07-31 03:11:58 +03:00
function main(a: u32) {
let mut b = 5u32;
2020-07-31 03:11:58 +03:00
if a == 1 {
b = 1;
2020-07-17 22:59:18 +03:00
} else {
2020-07-31 03:11:58 +03:00
b = 0;
2020-07-17 22:59:18 +03:00
}
2020-07-31 03:11:58 +03:00
if a == 1 {
assert_eq!(b, 1);
} else {
assert_eq!(b, 0);
}
}