summaryrefslogtreecommitdiff
path: root/tests/micropython/viper_binop_multi_comp.py
blob: 997c397d4c5e00b093ec0912013b575e133f5673 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# test multi comparison operators
@micropython.viper
def f(x: int, y: int):
    if 0 < x < y:
        print(x, "<", y)
    if 3 > x > y:
        print(x, ">", y)
    if 1 == x == y:
        print(x, "==", y)
    if -2 == x <= y:
        print(x, "<=", y)
    if 2 == x >= y:
        print(x, ">=", y)
    if 2 == x != y:
        print(x, "!=", y)


f(1, 1)
f(2, 1)
f(1, 2)
f(2, -1)
f(-2, 1)