zig/test/behavior/bugs/718.zig
Andrew Kelley 4307436b99 move behavior tests from test/stage1/ to test/
And fix test cases to make them pass. This is in preparation for
starting to pass behavior tests with self-hosted.
2021-04-29 15:54:04 -07:00

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);
}