mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
11 lines
189 B
Zig
11 lines
189 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "integer truncation" {
|
|
const a: u16 = 0xabcd;
|
|
const b: u8 = @truncate(a);
|
|
try expect(b == 0xcd);
|
|
}
|
|
|
|
// test
|