summaryrefslogtreecommitdiff
path: root/test/asset/parser/function.et
blob: 2a096b97d2f29fffff5b83cadef045db84ae4c31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
def f (x) and y = (x + y) + 1

def g (x) and y = (x + (y+1))

test Test:
    guard (1 == 1)
    guard (1 /= 2)
    let x = 2
    guard (x == x)
    guard (x /= 1)
    guard (x /= x + 1)

    guard (f 1 and 2 == 4)
    guard (f 1 and 2 == g 1 and 2)
    guard (f 1 and (g 2 and 3) == g 1 and 2 + 4)
    guard (f (10 + g and 1 1) and (g 2 and 3) == g 1 and 2 + 10 +6)