mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 01:04:43 +01:00
10 lines
202 B
Zig
10 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
|