4307436b99
And fix test cases to make them pass. This is in preparation for starting to pass behavior tests with self-hosted.
13 lines
232 B
Zig
13 lines
232 B
Zig
const std = @import("std");
|
|
|
|
test "lazy sizeof comparison with zero" {
|
|
const Empty = struct {};
|
|
const T = *Empty;
|
|
|
|
std.testing.expect(hasNoBits(T));
|
|
}
|
|
|
|
fn hasNoBits(comptime T: type) bool {
|
|
return @sizeOf(T) == 0;
|
|
}
|