mirror of
https://github.com/ziglang/zig.git
synced 2026-01-13 10:55:11 +00:00
And fix test cases to make them pass. This is in preparation for starting to pass behavior tests with self-hosted.
18 lines
393 B
Zig
18 lines
393 B
Zig
const std = @import("std");
|
|
const mem = std.mem;
|
|
const expect = std.testing.expect;
|
|
const Keys = struct {
|
|
up: bool,
|
|
down: bool,
|
|
left: bool,
|
|
right: bool,
|
|
};
|
|
var keys: Keys = undefined;
|
|
test "zero keys with @memset" {
|
|
@memset(@ptrCast([*]u8, &keys), 0, @sizeOf(@TypeOf(keys)));
|
|
expect(!keys.up);
|
|
expect(!keys.down);
|
|
expect(!keys.left);
|
|
expect(!keys.right);
|
|
}
|