add behavioral test case for previous commit

This commit is contained in:
Andrew Kelley 2019-12-06 12:27:56 -05:00
parent f64cff3e16
commit b1895da9b8
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -130,3 +130,17 @@ test "Type.Undefined" {
test "Type.Null" {
testTypes(&[_]type{@typeOf(null)});
}
test "@Type create slice with null sentinel" {
const Slice = @Type(builtin.TypeInfo{
.Pointer = .{
.size = .Slice,
.is_const = true,
.is_volatile = false,
.is_allowzero = false,
.alignment = 8,
.child = *i32,
.sentinel = null,
},
});
testing.expect(Slice == []align(8) const *i32);
}