aboutsummaryrefslogtreecommitdiff
path: root/test/standalone/static_c_lib/foo.zig
blob: a5ba90c95dab97f3a6fa77526f557a1737d054a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
const std = @import("std");
const expect = std.testing.expect;
const c = @cImport(@cInclude("foo.h"));

test "C add" {
    const result = c.add(1, 2);
    expect(result == 3);
}

test "C extern variable" {
    expect(c.foo == 12345);
}