mirror of
https://github.com/ziglang/zig.git
synced 2024-11-28 08:02:32 +00:00
19 lines
332 B
Zig
19 lines
332 B
Zig
const assert = @import("std").debug.assert;
|
|
|
|
struct Foo {
|
|
a: f32,
|
|
b: i32,
|
|
c: bool,
|
|
d: ?i32,
|
|
}
|
|
|
|
#attribute("test")
|
|
fn initializing_a_struct_with_zeroes() {
|
|
const foo: Foo = zeroes;
|
|
assert(foo.a == 0.0);
|
|
assert(foo.b == 0);
|
|
assert(foo.c == false);
|
|
assert(if (const x ?= foo.d) false else true);
|
|
}
|
|
|