mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
12 lines
213 B
Zig
12 lines
213 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "coerce to optionals" {
|
|
const x: ?i32 = 1234;
|
|
const y: ?i32 = null;
|
|
|
|
try expect(x.? == 1234);
|
|
try expect(y == null);
|
|
}
|
|
|
|
// test
|