about summary refs log tree commit diff
path: root/lang/zig/assign.zig
blob: 9ce2400a4cba855ed6d60c0d80546d962e6cd4ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const x = 1234;
var b: u6 = add(10, a);
const a = add(12, 34);

fn add(l: u6, r: u6) u6 {
    return l + r;
}

test "var" {
    var y: u13 = 5678;
    y += 1;
    expect(y == 5679);
}

test "init" {
    var z: i1 = undefined;
    z = -1;
}

test "global" {
    expect(a == 46);
    expect(b == 56);
}

const expect = @import("std").testing.expect;