test_coerce_optionals.zig (213B) - Raw
1 const std = @import("std"); 2 const expect = std.testing.expect; 3 4 test "coerce to optionals" { 5 const x: ?i32 = 1234; 6 const y: ?i32 = null; 7 8 try expect(x.? == 1234); 9 try expect(y == null); 10 } 11 12 // test