zig/test/c_import/c_char_signedness.zig
Jacob Young 2291560424 c_import: extract behavior tests that use @cImport
This introduces the new test step `test-c-import`, and removes the
ability of the behavior tests to `@cImport` paths relative to `test`.
This allows the behavior tests to be run without translate c.
2024-02-20 18:44:43 +01:00

14 lines
408 B
Zig

const std = @import("std");
const builtin = @import("builtin");
const expectEqual = std.testing.expectEqual;
const c = @cImport({
@cInclude("limits.h");
});
test "c_char signedness" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try expectEqual(@as(c_char, c.CHAR_MIN), std.math.minInt(c_char));
try expectEqual(@as(c_char, c.CHAR_MAX), std.math.maxInt(c_char));
}