mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
test: remove @cImport usage in interdependent_static_c_libs
This commit is contained in:
parent
4dba253cd2
commit
ab1946de92
1 changed files with 3 additions and 2 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const expect = std.testing.expect;
|
const expect = std.testing.expect;
|
||||||
const c = @cImport(@cInclude("b.h"));
|
|
||||||
|
extern fn sub(a: i32, b: i32) i32;
|
||||||
|
|
||||||
test "import C sub" {
|
test "import C sub" {
|
||||||
const result = c.sub(2, 1);
|
const result = sub(2, 1);
|
||||||
try expect(result == 1);
|
try expect(result == 1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue