| 1 | const std = @import("std"); |
| 2 | const expectEqual = std.testing.expectEqual; |
| 3 | |
| 4 | test "coerce to optionals wrapped in error union" { |
| 5 | const x: anyerror!?i32 = 1234; |
| 6 | const y: anyerror!?i32 = null; |
| 7 | |
| 8 | try expectEqual(1234, (try x).?); |
| 9 | try expectEqual(null, (try y)); |
| 10 | } |
| 11 | |
| 12 | // test |