add test for truncate on comptime integers

closes #703
This commit is contained in:
Andrew Kelley 2019-02-15 02:02:19 -05:00
parent c58b802034
commit ee5e196f88
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -29,3 +29,8 @@ test "truncate sign mismatch but comptime known so it works anyway" {
var result = @truncate(i8, x);
expect(result == 10);
}
test "truncate on comptime integer" {
var x = @truncate(u16, 9999);
expect(x == 9999);
}