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

16 lines
214 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 {
2020-08-17 03:20:47 +03:00
console.assert(b == 1);
2020-07-31 03:11:58 +03:00
} else {
2020-08-17 03:20:47 +03:00
console.assert(b == 0);
2020-07-31 03:11:58 +03:00
}
}