leo/compiler/tests/statements/conditional/chain.leo

13 lines
188 B
Plaintext
Raw Normal View History

2020-07-31 03:11:58 +03:00
function main(a: u32, b: u32) {
let mut c = 0u32;
2020-06-13 13:39:51 +03:00
2020-07-31 03:11:58 +03:00
if a == 1 {
c = 1;
} else if a == 2 {
c = 2;
2020-07-17 22:59:18 +03:00
} else {
2020-07-31 03:11:58 +03:00
c = 3;
2020-07-17 22:59:18 +03:00
}
2020-06-13 13:39:51 +03:00
2020-08-17 03:20:47 +03:00
console.assert(c == b);
2020-06-13 13:39:51 +03:00
}