v2 / vlib / v / tests / infix_expr_with_overflow_test.v
14 lines · 11 sloc · 180 bytes · e1758bc0c5d3c217b32d10b8e3af62d778c29bc2
Raw
1fn test_infix_expr_with_overflow() {
2 a := u8(255)
3 b := u8(1)
4 c := a + b
5
6 println(c)
7 assert c == 0
8
9 println(a + b)
10 assert a + b == 0
11
12 println(a + b < a)
13 assert a + b < a
14}
15