| 1 | const std = @import("std"); |
| 2 | const expectEqual = std.testing.expectEqual; |
| 3 | |
| 4 | test "integer truncation" { |
| 5 | const a: u16 = 0xabcd; |
| 6 | const b: u8 = @truncate(a); |
| 7 | try expectEqual(0xcd, b); |
| 8 | } |
| 9 | |
| 10 | // test |