| 1 | module simple |
| 2 | |
| 3 | pub fn sum() int { |
| 4 | mut res := 0 |
| 5 | for i in 1 .. 5 { |
| 6 | res += i |
| 7 | } |
| 8 | return res |
| 9 | } |
| 10 | |
| 11 | pub fn mul() int { |
| 12 | mut res := 1 |
| 13 | for i in 1 .. 5 { |
| 14 | res *= i |
| 15 | } |
| 16 | // the lines here are just to introduce an asymmetry in the reported coverage lines |
| 17 | c := res * 2 |
| 18 | _ := c * 10 |
| 19 | return res |
| 20 | } |
| 21 | |
| 22 | pub const a_const = f() |
| 23 | |
| 24 | fn f() int { |
| 25 | return 50 // this should be executed always |
| 26 | } |
| 27 |