mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-26 13:01:34 +03:00
11 lines
202 B
Zig
11 lines
202 B
Zig
const std = @import("std");
|
|
const expectEqual = std.testing.expectEqual;
|
|
|
|
test "integer truncation" {
|
|
const a: u16 = 0xabcd;
|
|
const b: u8 = @truncate(a);
|
|
try expectEqual(0xcd, b);
|
|
}
|
|
|
|
// test
|