mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
12 lines
229 B
Zig
12 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
|