mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
13 lines
229 B
Zig
13 lines
229 B
Zig
const std = @import("std");
|
|
const expectEqual = std.testing.expectEqual;
|
|
|
|
test "coerce to optionals" {
|
|
const x: ?i32 = 1234;
|
|
const y: ?i32 = null;
|
|
|
|
try expectEqual(1234, x.?);
|
|
try expectEqual(null, y);
|
|
}
|
|
|
|
// test
|