mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 02:44:43 +01:00
10 lines
247 B
Zig
10 lines
247 B
Zig
const std = @import("std");
|
|
const expectEqual = std.testing.expectEqual;
|
|
|
|
test "coercing large integer type to smaller one when value is comptime-known to fit" {
|
|
const x: u64 = 255;
|
|
const y: u8 = x;
|
|
try expectEqual(255, y);
|
|
}
|
|
|
|
// test
|