scope variables in floating point cast tests
Fixes a bug where the result of a @floatCast wasn't actually checked; it was checking the result from the previous @floatCast.
This commit is contained in:
parent
4de60dde6e
commit
0ebc7b66e6
@ -418,19 +418,24 @@ test "@intCast comptime_int" {
|
||||
}
|
||||
|
||||
test "@floatCast comptime_int and comptime_float" {
|
||||
{
|
||||
const result = @floatCast(f32, 1234);
|
||||
assert(@typeOf(result) == f32);
|
||||
assert(result == 1234.0);
|
||||
|
||||
const result2 = @floatCast(f32, 1234.0);
|
||||
}
|
||||
{
|
||||
const result = @floatCast(f32, 1234.0);
|
||||
assert(@typeOf(result) == f32);
|
||||
assert(result == 1234.0);
|
||||
}
|
||||
}
|
||||
|
||||
test "comptime_int @intToFloat" {
|
||||
{
|
||||
const result = @intToFloat(f32, 1234);
|
||||
assert(@typeOf(result) == f32);
|
||||
assert(result == 1234.0);
|
||||
}
|
||||
}
|
||||
|
||||
test "@bytesToSlice keeps pointer alignment" {
|
||||
|
Loading…
x
Reference in New Issue
Block a user