test_coerce_large_to_small.zig (234B) - Raw
1 const std = @import("std"); 2 const expect = std.testing.expect; 3 4 test "coercing large integer type to smaller one when value is comptime-known to fit" { 5 const x: u64 = 255; 6 const y: u8 = x; 7 try expect(y == 255); 8 } 9 10 // test