From b1895da9b8c41152d146b54e16162de44a08a087 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 6 Dec 2019 12:27:56 -0500 Subject: [PATCH] add behavioral test case for previous commit --- test/stage1/behavior/type.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test/stage1/behavior/type.zig b/test/stage1/behavior/type.zig index 432a1e0e94..e6b2cd7ff1 100644 --- a/test/stage1/behavior/type.zig +++ b/test/stage1/behavior/type.zig @@ -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); +}