mirror of
https://github.com/ziglang/zig.git
synced 2024-11-29 00:22:33 +00:00
13 lines
244 B
Zig
13 lines
244 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
const c = @cImport(@cInclude("foo.h"));
|
|
|
|
test "C add" {
|
|
const result = c.add(1, 2);
|
|
try expect(result == 3);
|
|
}
|
|
|
|
test "C extern variable" {
|
|
try expect(c.foo == 12345);
|
|
}
|